Skip to main content

Hey @jayeshkumarbhatia! 👋

I managed to get things working so I could continue building out this workflow! As a recap I’d like to use the invoice number that we found using the JS code to find an invoice in Xero and then send it out.

When I use the JS output in the “Find invoice in Xero” step, the invoice can’t be found. However when I hardcode it and input “INV-0018” directly it works. Looks like there might be a discrepancy in the formatting?

Do you know how I might be able to figure out what format Xero is looking for in the invoice number field and how I could convert the JS output to match that? 

 

Can you share the test data of code by Zapier here? Share in both format screenshot and text format


Can you share the test data of code by Zapier here? Share in both format screenshot and text format

Hey @jayeshkumarbhatia !

Sure thing - I did a copy/paste of the Slack message as the input

Here’s the text + screenshot below

💸 An invoice has been created for Marina! 💸 Email: team@earlywork.co 1. Please log into Xero and approve the invoice - INV-0018 2. Click on the 3 dots on this message and click on "Push to Zapier" ✅ emoji when done Sent via zapier.com/app/editor/190431182#slack

 


Can you copy the test data of code by Zapier and share here? 

Did I share the wrong thing in the thread above?


Hey @earlywork_team ,

 

Can you this text and paste it?

 

 


Hi @earlywork_team!

In addition to sharing the text that @jayeshkumarbhatia has highlighted above, could you please share a screenshot of the Xero step? It would be helpful to see how the output of the code step is mapped in the find invoice action. Thanks!


Hey everyone! Thanks for chipping in! Turns out the issue was the invoiceNumber variable had a new line character at the end of it!

Trimming it off did the trick 👌


Hi @earlywork_team,

Awesome! We’re glad to know you were able to get it sorted!

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


Hey @jayeshkumarbhatia! 👋

I managed to get things working so I could continue building out this workflow! As a recap I’d like to use the invoice number that we found using the JS code to find an invoice in Xero and then send it out.

When I use the JS output in the “Find invoice in Xero” step, the invoice can’t be found. However when I hardcode it and input “INV-0018” directly it works. Looks like there might be a discrepancy in the formatting?

Do you know how I might be able to figure out what format Xero is looking for in the invoice number field and how I could convert the JS output to match that? 

 

Analyze the format of the JS output that you're using to find the invoice number. Compare it with the format that works when you hardcode the value (e.g., "INV-0018"). Look for any differences in structure or syntax. Once you identify the differences, you can modify the JS code or use string manipulation functions to convert the output to the expected format. Regards 


Reply