Remove commas in numbers for JSON output

Is there a way to format a number without commas in the template used for JSON output? I don’t want to lose the commas in the app, just in the JSON file output.

0 14 4,189
14 REPLIES 14

SUBSTITUTE( [number] , “,” , “” ) might work.

@JNeufeld

CONCATENATE([Your_Number_Column])

Thanks, all.

CONCATENATE() worked great. Didn’t try the other.

A couple points for everyone’s better understanding (my own included):

So I’m assuming there is not a comma in the actual data value number, so my substitute() suggestion actually wouldn’t work (unless it was a text value). The comma is just a formatting thing, from the ‘show thousands seperator’ toggle in the column definition being turned on.

Concatenate works because it converts the actual value (comma-less, before formatting) into a text value, thereby removing/ignoring the comma formatting. Correct?

Another point is that apparently the comma seperator formatting not only shows in the app, but also gets passed on to the JSON webhook. I would think that only the raw value would get passed on in such a case, is there some rationale why the comma remains?

@JNeufeld
@Marc_Dillon
Actually, you shouldn’t be needing to do this because the number formatting is not carried to a JSON parameter’s value. The number is always a number and when you apply the CONCATENATE expression, than the numerical figure will be converted to text. Provided you are making some calculations with that value at the endpoint, that it will result with an error.

@Phil may I request your advise here?

I face the opposite of this:

because the number formatting is not carried to a JSON parameter’s value.

Column type is “Number”
Workflow action/Webhook
Body type : json template
Body template: BodyTemplate_20200926_101313.json

When Thousand separator is included webhook fails. When it is disabled it works

Am I missing something?

Sounds to me like you’re facing the same issue, not the opposite?

Did you wrap the column in CONCATENATE(), like suggested in this thread, in your template?

Opposite of the quote. Same as the Topic

Waiting for any other suggestion.

There are already 2 suggestions in this thread, have you tried them or not? Do they work, or do they somehow not meet your requirements? What other details can you give for your situation?

It is in production I do not want to change it multiple times.

I want to know if something is missing? Why it does not act as expected.

I may try to multiply it by 1 if, I do not get any response.

Perhaps you should put together a testing app for testing?

Probably.

You’re probably doing something wrong, or not doing something you should be.

Good luck! Let us know if you need further help.

COCATENATE() Did it well…
SUBSTITUTE() did not work. (Comma stayed there. I used expression not just coulumn value)

Multiply by one did not work.

Thanks all … Thanks @LeventK

Note: I am interested if, anyone does it without either one…

Correct, in that there is no comma in the original value for SUBSTITUTE() to remove. But, in passing through SUBSTITUTE(), the original value is converted to Text (without formatting and thus without commas). So, in this case, your SUBSTITUTE() is effectively equivalent to @LeventK’s CONCATENATE().

Correct.

I had to deal with this today. Adding ""& is equivalent to CONCATENATE(), and much easier to manage in a large template.

i.e., change

<<[number]>>

to

<<""&[number]>>
Top Labels in this Space