Skip to main content

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?

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 

  1. You need to remove the extra fields.
  2. 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
    1. 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
    2. That outputs a “text” variable that is a block of concatenated text
    3. That is what should be mapped as an input into the Code step
    4. 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
    5. 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