Question

How to replace separator in Shopify "Line Item Properties Value" from comma

  • 1 May 2023
  • 8 replies
  • 232 views

Userlevel 1

I have a product customisation form in Shopify that customers input their messages in the respective fields in the form:

Name: John

Sex: Male

Message: Hello

 

I then use zapier to extract the shopify inputs from "Line Item Properties Value". The inputs in the respective fields in the form are separated by commas:

John,Male,Hello. 

 

This is OK but if the customer inputs commas into the fields like the example below, I then run into problems:

Name: John

Sex: Male

Message: Hello, world

 

The Line Item Properties Value then shows: "John,Male,Hello,world" as if I had 4 fields. In reality I have 3 fields. But because of the comma in the message "Hello, world", it recognized "world" as the 4th input. 

 

I think the way to resolve this is to change the separator in Shopify to "|" instead of comma. Or is there a workaround in Zapier? 

 

How do I do this? Thanks a million!


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

8 replies

Userlevel 7
Badge +8

Hi @zhhan 

 

Have you tried Formatter by Zapier > Utilities > Line Itemizer ? 

 

Also, I would checkout this article about using OpenAI to parse emails (in your case it would be parsing this field instead). 

 

Hope this helps

Userlevel 1

I have used the line itemizer before but I recall it still needs to extract the original Shopify-provided data which is "Line Item Properties Value” and that is already captured as “John,Male,Hello” with comma as the separator. 

Let me explore that again. 

Userlevel 7
Badge +12

Hi @zhhan!

Could you share a screenshot of test data for the Shopify trigger/action? Specifically, it would be helpful to see the line items properties value fields where there is a comma in one of the responses. To be super clear, I’d like to see what the data looks like in the test section, not what the field looks like when you map it in an aciton. Don’t forget to remove or obscure any personal or private information in any screenshot you share in the community (eg full name, email address, etc).

I have a feeling that there is the correct number of fields, but it looks wrong because of the way that line items are displayed in the Zap editor.  

Thanks!

Userlevel 1

Hi @zhhan!

Could you share a screenshot of test data for the Shopify trigger/action? Specifically, it would be helpful to see the line items properties value fields where there is a comma in one of the responses. To be super clear, I’d like to see what the data looks like in the test section, not what the field looks like when you map it in an aciton. Don’t forget to remove or obscure any personal or private information in any screenshot you share in the community (eg full name, email address, etc).

I have a feeling that there is the correct number of fields, but it looks wrong because of the way that line items are displayed in the Zap editor.  

Thanks!

 

Sure, here’s the screenshot where I see the Line Items Properties Value from Shopify:
 

 

Userlevel 1

You can see from the screenshot above that the Line Items Properties Value separators are commas. Thus, any inputs into fields with commas would be identified wrongly as a separator.

Any method to resolve this? 

Userlevel 7
Badge +12

Hi @zhhan, thanks for sharing the screenshot. 

When Shopify creates the line items, it doesn’t use a comma as the separator. When Zapier shows the line-items in the editor, it shows as being comma-separated, but the line items will be on the correct lines.

If you look at the trigger test, you should see the line items on different lines, even when there’s a comma in them:

But when you add the field to a Zap action, it will look like it’s just comma separated:

 

Any items where there is a comma in the item name will still be treated as a single line item. If you’re using the line-items exactly as they are in the next step of a Zap, it will work as you would expect (with the correct number of line items). 

 

I hope that clears things up!

Userlevel 1

Hi @Danvers, thanks for the reply!

Apologies, my initial screenshot didn’t tell the full story so I think there is some confusion/misunderstanding. The screenshot I posted showed how normal inputs would work. I misread your initial message about showing a screenshot example of how it would not work.

Please see the screenshots 1 and 2below on the problem I am facing. Customer inputs “National Pet Hospital, Singapaw” which has a comma. But in Zapier, the comma is recognised as a separator when it should not be.

So sorry for the initial confusion! 

 

Screenshot 1

 

Screenshot 2

 

Userlevel 7
Badge +12

Hi @zhhan!

Thanks for sending the additional screenshots. I think we’re on the same page 😊 

In the editor, it looks like there’s an extra line item (because of the comma), but there isn’t. The information from the Shopify trigger shows that it knows that the data is a single item and not two. If the comma were confusing things, you would see an extra line of data in the shopify trigger test eg

 

Registered at* (40 characters)

NATIONAL PET HOSPITAL

 

Registered at* (40 characters)

SINGAPAW

 

Maybe I’m misunderstanding why the comma is a problem. What action do you want to use the line items in? Do you need to convert the line items into separate fields before you can use them in a different step of the Zap? 

If you want to use the Line Items value field in an action that is expecting to see line items, you shouldn’t run into a problem. If you haven’t tested the action yet, please could you give it a try and see what happens? If it hits an error or doesn’t do what you need it to, could you please let us know what app and action you’re using the shopify line items in?

Thanks!