Skip to main content
Best answer

Converting SKUs from text to an array for Xero invoice creation in Zapier


Forum|alt.badge.img+1

I’m trying to take product SKUs from a Pipedrive Find Deal step, to look up a Xero Product Id and then create an invoice.

I’ve started with Zapier Tables. If I provide a single 3 digit SKU it works fine, but if I send it multiple values it fails

I thought this was because the output from the Find Product steps is text e.g. 288,152,195. So I’ve used Text to Line Item to create an array which works fine.

 


 

When I run the lookup in the Table Step, I use the look up value as the results from the Text to Line Item Array. However it fails that nothing can be found, if I look at Data In in the console , the look up value are the same 288,152, 195. I was expecting it to be more like the format above.

I’ve tried using Find Records and Find Records (Output as Line Items). Any ideas, I can provide more screenshots of any steps. Any ideas, I feel I’ve missed something obvious. Many Thanks Bizzer

Best answer by BizzerBest answer by Bizzer

Hi Troy I thought I replied this morning. I managed to fix this, it was the Operator in the Table config set to ‘Exact match’ instead of ‘One of ‘, School boy error. Thank you again for your help

Regards

Bizzer

View original
Did this topic help you find an answer to your question?

8 replies

Troy Tessalone
Forum|alt.badge.img+14

Hi ​@Bizzer 

The screenshot shows an array of arrays. (e.g. 1>1, 2>1, etc.)
That means the original data was likely originally formatted as an array before being manipulated via the Formatter step.

 

For us to have more info, post screenshots showing how your Zap steps are outlined and configured in EDIT mode with the field mappings visible.

Make sure to include a screenshots that shows how the data is originally returned from its origin Zap step.

 

 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 11 replies
  • March 12, 2025

OK here it goes:

I see your point, the results of the PipeDrive Find Deal the data looks to be in an array, its hard to fit in the screenshot but think you can see it for the first item 288:

 


Then in Utilities - Text to Line Item Value the value above from Find Deal in Pipedrive, the configure tab looks like this:

 

In the console it looks like this. Data In: I assume this is a string 

 

Data out: 

 

Then in Zapier Tables Configure tab:

 

In the Data in:

 

I’ve tried various things like using the results from the Pipedrive - Find Deal as the lookup in the Tables therefore skipping the Line Itemizer part. Same issue, if I hardcode a string 288,152,195 that fails but I expected that. Hope that’s clear as mud

PS I dd see an article somwhere of how to read the console as in what’s an array and what’s a sting, but I can’t seem to find it

 


Troy Tessalone
Forum|alt.badge.img+14

@Bizzer 

Can you post screenshots showing how your Zap steps are outlined at a high level, so we can have context about what your Zap step flow looks like?


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 11 replies
  • March 12, 2025

Sure two screenshots to follow:

Here I find the deal, there is a delay so another zap can do its business or adding products to the deal. 
I then Find the deal as it has products which I went to add to an Invoice in Xero

Step 5, was an attempt to remove a discount product from the items to be added in Xero as its has a 0 value. Its currently redundant, I don’t use the output from it, again I had issues with text/arrays
 


Step 6  - I the Text to line item to turn the string in this case: 288,152, 195
Step 7 - Tables to pass the results of Step 6 to find the matching products in the Xero Product Id columns in the table
 

Step  8 create the invoice
Step 9 and 10 looks for a custom filed in Pipedrive and if it has an amount in the field to add the discount product. This is all messy as there is no way in Zapier due to I assume a Pipedrive API restriction that allows adding a discount to a deal.

I wondered it was the data in the tables, but I have tried each item code individually. Perhaps its because the Pipedrive colum is numeric, I’ll try change it to text but I don’t think that’s it

thanks

​​​​​​​Bizzer


Troy Tessalone
Forum|alt.badge.img+14

@Bizzer 

Can you post screenshots showing how your Xero step is configured in EDIT mode with the field mappings visible?
If Xero supports line items in the Zap step, then you should be able to just map the desired variables from the Pipedrive step.

 

The data returned from Pipedrive Step 3 is already an array, so trying to use Formatter > Utilities > Text to Line Items, is why you are then getting the nested arrays, so you probably do not need this step.

 

 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 11 replies
  • March 12, 2025

Hi Troy 

Thanks for the updates. 

‘Can you post screenshots showing how your Xero step is configured in EDIT mode with the field mappings visible?
If Xero supports line items in the Zap step, then you should be able to just map the desired variables from the Pipedrive step.’


All of the Xero steps or the one where I try to add the products to the invoice. In edit I do not see the any field mapings. I’d expect to see the output of the Find Records in the circled area. Xero does allow input of line items in this field. Originally I had hardcoded the Product Ids in Xero to be the same as Pipedrive for testing, but now I’m moving to production and need to use the actual products Ids which are text not numeric (surely that’s can’t be it)

 

If I remove the Text to Line item i get the same result, here is the config:

 

 

And the result:

 

For completeness I’ve here is the contents of the table:

 

Thanks again, Bizzer


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 11 replies
  • Answer
  • March 13, 2025

Hi Troy I thought I replied this morning. I managed to fix this, it was the Operator in the Table config set to ‘Exact match’ instead of ‘One of ‘, School boy error. Thank you again for your help

Regards

Bizzer


ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • 6466 replies
  • March 14, 2025

That’s great news ​@Bizzer! Glad to hear that the issue is now resolved!

If you have any other questions, please don’t hesitate to reach out to the Community. We’re always happy to help! 🤗


Reply