Error of "Json to Table" node due to long number

Hello.

Json to Table node got an error when the data has long number.
The length of the number is about 40.
How can I convert this json to table?
I think Json to Table node convert this number to Number type but it should be Double type…

I’d appreciated it if you help this problem.

Thanks,
hhkim

Hi @hhkim , it would help if you showed us what you are doing, and provide some sample data where we can test/play with

1 Like

Thank you for your help!

I attached test data and workflow.

I tested it again and it worked but the value was changed.

  • original number : 12345678901234567890123456789
  • changed number : 5097733592125636885

Thanks,
hhkim
number_test.txt (38 Bytes)
number test.knwf (9.4 KB)

Thanks @hhkim . I’ve not taken a look at your workflow yet, but the integer type that can hold the biggest number is a Long type, and 12345678901234567890123456789 goes way beyond what a Long can hold.

The only way around this is to treat this value as a string.

A double type that you suggested would also be as limited, and would be represented as a float.

Thank you for your quick reply.

Then how can I add double quotation to long number in json?
Will “Json Transformation” node help to solve this problem?

Thanks,
hhkim

Hi @hhkim , I’ve loaded your workflow. You can manipulate the data before transforming the string to JSON.

I can’t see your whole data to come up with a more generic manipulation, but for your sample data, the idea would be to transform:
{"a":12345678901234567890123456789}
to:
{"a":"12345678901234567890123456789"}

I added the quotes via the String Manipulation node:
image

And now I have this:
image

With this modification, I get the proper value when converting JSON to Table:
image

Here’s the workflow: number test - Bruno.knwf (11.3 KB)

Obviously the manipulation can be more complex with more data. If you have issues with real data, we can help come up with more generic manipulation.

Thank you so much.
I will try it with real data.

Thanks,
hhkim

Hi @hhkim,

you could also use JSON Path Node, because there you can specify which format the output should have:

Best regards,

Paul

Thank you for your help.

I used “Json path” node and it helped to solve this problem.
Thank you so much.

Best Regards,
hhkim

Hi @hhkim

JSON Path is definitely an option, but this will retrieve just this path. Given that you used JSON To Table, I assumed that you wanted to translate a whole JSON string into multiple columns in a table.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.