Question

Shopify Line Item Properties Values on Products

  • 24 November 2022
  • 10 replies
  • 64 views

Hi. I am trying to push Shopify Orders into Salesforce, with each product on the order itself as a different line item. This is a test order with 3 products, and variations on the product fields:

 

Interestingly, when searching for a sample in the first step, it will split out the values as line items:

 

 

 

However, it’s not possible to use those parsed out values in anything, as it gets grouped up into a consolidated field called Line Item Properties Value. It also appears that each product contains the line item properties of all the products combined, so you get something like:

 

 

Even if I were to do a Formatter → Split text by comma, it would still look like this:

This repeats 3 times for the 3 products I had in my Order.

I saw this thread here by @GetUWired, which may work if there wasn’t any repeating issues, but is there anything that can be done here using Zapier? I don’t think looping through it would work either since the order would never be consistent. 

 

Thanks in advanced!

 


10 replies

Userlevel 7
Badge +8

Hi @RH_Z 

 

You will need to use Looping by Zapier > From Line Items . This way the zap will loop for each of the line items separately. 

@MohSwellam I am already using a Loop in the last step, to create line items in Salesforce from the Shopify Products themselves. I need another way to loop through the additional properties within each Shopify Product, if that’s possible.

Userlevel 7
Badge +8

Thanks for the clarification @RH_Z , this is unusual. 

 

Did you try adding the Properties through the Loop? 

Userlevel 7
Badge +12

It looks like the Line item Properties are nested values, which is why it’s proving difficult to work with them the way that you need. 

Did you try Moh’s suggestion of using looping to add the Properties field?

If you’re still having some trouble, could I ask you to share a screenshot of what the Line item Properties field looks like when you put it into a field in the Zap editor? 

And could you confirm which pieces of information from the Properties you need to add to Salesforce? Thanks!

Sorry @MohSwellam I thought I had replied but I don’t see it on here! @Danvers I was able to make this actually work using similar steps from an article here:

 Shopify has Line Item Names and Values that didn’t split the way the example had, so I used the Line Itemizer utility on the parent level just called Line Item Properties. It splits properly, until the one of the property values themselves has a comma in it, which then splits those into their own line, as such:

 

 

the “e personal2” value should be part of the previous “e personal” value. Because of these splits, the loop doesn’t work since it just ties the incorrect “e personal 2” to the 2nd product in the loop and nothing else.

I have also tried adding a text replacement step before it, by replacing , with ^^^ to bypass the Line Itemizer, but found out that some of the properties are combining together, like so: 

 

 

The “name: deflabel” should be its own name/value, so should “name: First Name”. It’s appearing to be adding a stray comma as well since it’s being caught with the replacement step.

I’ve also tried to add a few more text replacement steps to eventually use the [:newline:], which does work in making it visually appear correct, but it loses the place where it was tied to the original product.

In that second screenshot, is there a way to turn any “^^^name:” prefixes into its own line item? Or in the first screenshot, is there a way to reverse the split due to the commas?

Thank you both!

Also I did run the original Properties through the Loop, and saw that the line items were being combined by a stray comma:

 

 

Userlevel 7
Badge +8

Hi @RH_Z 

 

I think you will have better results with a Code by Zapier step where you can split them by the names. This article is pretty helpful and I think it applies to your use case.

 


 

Userlevel 7
Badge +12

Hi @RH_Z, thanks for the extra info!

Just to make sure I understand where we’re at: you were able to create fields to use in Zapier using a code step (following the instructions in the article that you referenced

The issue is that because of commas in the data, the Formatter line-itemizer is sometimes creating a line item from half a field, is that right? If so, have you had the opportunity to try the solution from the article that Moh shared?

 

If I’ve misunderstood the issue or what you’re currently trying to do, please let me know! Thanks :)

 

@Danvers Yes, I was able to do the code step in the first article until the commas became an issue.

I did look at the article @MohSwellam shared, but that sample code snippet is assuming the fields will always be static and present in the data to parse. In my use case, a product may have an Email as a property field, and another product may not. 

I am also not savvy enough in JavaScript to be able to code out all of the scenarios, though it does appear that custom JavaScript is absolutely required here.

Userlevel 7
Badge +11

Hey @RH_Z!

I’ve read through all the replies here and I think I’d agree that your use case has some rough edges that make it tricky to accomplish without code that can account for that. Getting into the specific Javascript that you’d need is likely beyond what we can provide here in the Community.

You may consider reaching out to a Zapier Expert to see if anyone can help you out with that: https://zapier.com/experts

Reply