How can I seperate data by comma?

Hi all,

We have a field called serial_no in sales order item and it is storing serial numbers one after the other.

In print format if I print row.serial_no below is the output.

3ST17G0001 3ST17G0002 3ST17G0003 3ST17G0004 3ST17G0005

after every serial number it is taking one space, so I want to replace that space with comma.

Thanks and Regards
Vijay Pedapudi

Please can anybody help me out in this?

Try below code

{{ row.serial_no | replace(" ",",") }}

Thanks for your prompt reply!

Still data is not seperating by comma .

After this line of code {{ row.serial_no | replace(" “,”,") }}

Output: 3ST17G0001 3ST17G0002 3ST17G0003 3ST17G0004(printing with one space not with comma)

Hi @Vijay_Raju

{{ row.serial_no | replace(" ",",") }}

I have run the above code on local account and it’s working properly, can you please check the code again

1 Like

Hi Rohit

Tried several times and checked in 3 print formats but comma is not getting printed.

Is there any alternative solution?

@Vijay_Raju What type is your field “serial_no”?

@lasalesi type is Small Text.

@Vijay_Raju,

try

{{ row.serial_no | replace(" ","\n") }}

serial number field is small text and each serial number is separated by new line so above code should work.

Thanks,
Makarand

1 Like

@makarand_b

Tried above code but output is showing as below.

@Vijay_Raju,

Sorry try the following,

{{ row.serial_no | replace("\n",",") }}

1 Like

Big thanks to @makarand_b and @rohit_w.

above code is working fine.

1 Like