Troubleshooting empty values in Pipedrive line items for Code zaps
I’m using Pipedrive trigger and getting product details as line items to a Code zap:
The flow
The input data:
When I test, it appears that empty values are stripped out. Here is how “Data in” looks:
Because of that, I’m not able to retrieve the corresponding product values when looping through the line items since because index order is being broken.
Any advice for workaround?
Page 1 / 1
Hi @Digital Partner
Try converting the line items to text: Formatter > Utilities > Line Items to Text
You can specify the delimiter. (e.g. ^)
Then you can parse the text in the Code step using the delimiter to create line items.
I’ve tried using the formatter, however, it doesn’t seem to solve the issue. I've used || as a delimiter. Look at the example for Data in:
As you see the empty line items exists, however without inputs value
And here is what I get in Data out:
The empty line items are gone.
@Digital Partner
Post screenshots showing how your Formatter step is configured in the CONFIGURE tab while in EDIT mode with the field mappings visible.
Related article to reference that covers the general concept:
The configure tab looks like following @Troy Tessalone
@Digital Partner
You need to remove the extra fields.
You need to map all of the product fields from Pipedrive that you want to use in the Code step to be handled by the Formatter step
See screenshot below as an example where 2 array fields are mapped and separated by a pipe for the fields and a ^ for each line item
That outputs a “text” variable that is a block of concatenated text
That is what should be mapped as an input into the Code step
Then in the Code step you can split by ^ to get the line items, then split by | to get the different fields to use for each line item
This is because Code step inputs flatten any arrays to text thus losing their structure, so you have to create a text structure for the array items before passing into the Code step
@Digital Partner
If you are looking to hire help, there is a directory of Certified Zapier Experts: https://zapier.com/experts