Best answer

Find Invoice in Xero step not finding invoice

  • 21 April 2023
  • 8 replies
  • 73 views

Badge

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? 

 

icon

Best answer by earlywork_team 3 May 2023, 02:24

View original

8 replies

Userlevel 6
Badge +6

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

Badge

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

:money_with_wings: An invoice has been created for Marina! :money_with_wings: 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" :white_check_mark: emoji when done Sent via zapier.com/app/editor/190431182#slack

 

Badge

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

Did I share the wrong thing in the thread above?

Userlevel 6
Badge +6

Hey @earlywork_team ,

 

Can you this text and paste it?

 

 

Userlevel 7
Badge +12

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!

Badge

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 👌

Userlevel 7
Badge +6

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