Skip to main content
Best answer

Retain Comma in Input Value

  • October 22, 2024
  • 6 replies
  • 45 views

Code action is used.

Set the input to a list of phone numbers obtained from Salesforce, as shown below.
At this point, there is a comma in the value, like “,,,090-0000-4444,090-0000-1111”.

 

When you go to the next step and try to execute, the comma will be missing from the value.

 

Is there any way to treat this as data with commas?

Best answer by SamBBest answer by SamB

Hey @Suzuki 👋

It seems that part of the issue is that the commas that appear aren’t really there, they’re just how line items are visually separated in the Zap editor. And the other part is that with Formatter, null (empty) line items are ignored which is why you’re only seeing two values separated by a & in that Output Text field.

There was a workaround shared in the Community a while back that should allow you to convert those empty line items into a &:

Can you give that a try and let us know whether that does the trick?

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

6 replies

Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 30903 replies
  • October 22, 2024

Hi @Suzuki 

Add this Zap step before: Formatter > Utilities > Line Items to Text


JammerS
Forum|alt.badge.img+6
  • Zapier Staff
  • 2324 replies
  • October 23, 2024

Hey @Suzuki,

 

Please keep us in the loop for this one. Let us know if Troy’s recommendation got you going with your Zap. Thank you.


  • Author
  • Beginner
  • 3 replies
  • October 23, 2024
Troy Tessalone wrote:

Hi @Suzuki 

Add this Zap step before: Formatter > Utilities > Line Items to Text

Thank you for your reply.

 

I tried that, but it didn't solve the problem.

Similarly, the comma disappears in Data in.

 

I am expecting the output as below.

「&&&090-0000-4444&090-0000-1111」

 

 

 


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 7427 replies
  • Answer
  • October 23, 2024

Hey @Suzuki 👋

It seems that part of the issue is that the commas that appear aren’t really there, they’re just how line items are visually separated in the Zap editor. And the other part is that with Formatter, null (empty) line items are ignored which is why you’re only seeing two values separated by a & in that Output Text field.

There was a workaround shared in the Community a while back that should allow you to convert those empty line items into a &:

Can you give that a try and let us know whether that does the trick?


  • Author
  • Beginner
  • 3 replies
  • October 24, 2024
SamB wrote:

Hey @Suzuki 👋

It seems that part of the issue is that the commas that appear aren’t really there, they’re just how line items are visually separated in the Zap editor. And the other part is that with Formatter, null (empty) line items are ignored which is why you’re only seeing two values separated by a & in that Output Text field.

There was a workaround shared in the Community a while back that should allow you to convert those empty line items into a &:

https://community.zapier.com/code-webhooks-52/how-to-deal-with-a-null-value-in-a-line-item-389

Can you give that a try and let us know whether that does the trick?

 

Thank you for your reply.

 

I was able to resolve the issue using the method you shared.


ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • 6360 replies
  • October 24, 2024

Hi @Suzuki,

Thanks for the update here.

Please do keep us updated about this and if you’re stuck we’re happy to help further!