Skip to main content

So as the title suggests, I’m trying to create a Sales Order in Cin7 Core when a Deal is created in a certain pipeline and stage in HubSpot.

I’m 90% there, in that, when there was only 1 line item, the order was created perfectly.

The issue arises when there are multiple line items in the Deal.  There are two different issues I experience when I apply different approaches:

  1. When I remove the Filter (stage 😎, then the Zap creates separate Sales Orders for each line item.
  2. When I use the Filter to close the loop, only 1 of the line items is picked up in the Sales Order.

I’m new to Zapier and Looping in particular, so any help or advice would be gratefully received!  I assume it’s something simple like a step in the wrong place but I’m open to any feedback.  The Delay step is only there as a test to see if it helped (it didn’t).

Thanks!

 

Hi ​@DarrenRodman,

 

Welcome to the Community.

 

You'll need to structure your Zap carefully to create a Sales Order in Cin7 Core with multiple line items from a HubSpot Deal. First, check if a Sales Order exists; if not, create one. Then, retrieve the deal's line items and use a looping step (often requiring JavaScript) to add each item to the order. If coding isn't an option, hiring a Zapier Expert may help.

 

I hope this helps. Let us know if you need further assistance.


Hi ​@DarrenRodman,

 

Welcome to the Community.

 

You'll need to structure your Zap carefully to create a Sales Order in Cin7 Core with multiple line items from a HubSpot Deal. First, check if a Sales Order exists; if not, create one. Then, retrieve the deal's line items and use a looping step (often requiring JavaScript) to add each item to the order. If coding isn't an option, hiring a Zapier Expert may help.

 

I hope this helps. Let us know if you need further assistance.

Hi JammerS,

Thanks for coming back to me on this.  As you can see from the screenshots above, I’ve already included a looping step, and that’s the part I believe I need help with.

Many thanks,

Darren


Hi ​@DarrenRodman,

Could you please send a screenshot of the “CONFIGURE” section of the Filter, Looping, and Create Sale step? This will help me identify if the setup correct.

Please don't include personal information in the screenshot, or be sure blur out any personal information.

Thank you!


Hi ​@ken.a,

Here you go - sorry, lots of screenshots on the ‘Create Sale’ step!

Thanks very much,

Darren

 

 


Hi ​@DarrenRodman,

Thanks for the screenshots!

It looks like you did not map the output of the Looping step to your Cin7 Core Inventory step. You’d need to map the output of the looping step to the action for the looping function to work.

We have instructions on how to utilize Looping by Zapier here: https://help.zapier.com/hc/en-us/articles/8496106701453-Loop-your-Zap-actions

Hopefully, this helps.


Hi ​@ken.a,

Forgive my ignorance, but what does mapping the Looping output to the ‘Create Sale’ step look like in real terms here?

Guessing it means I need to link the below to somewhere else other than step 7 to get the looped line items?

If you can advise me on the specifics that would be appreciated!

Many thanks,
Darren

 


Hi ​@DarrenRodman,

 

Mapping the Looping output to the 'Create Sale' step means using the processed data from the Looping step in the sale creation process. In 'Create Sale,' select fields, find the Looping step data in the dropdown, and map the relevant values (for example, item name and price) accordingly. The exact labels depend on your Zap setup. 

 

I hope this helps clarify things. If you have any more questions or need further assistance, don't hesitate to ask.


Hi ​@JammerS,

Do you mean mapping the ‘Line Item’ section in ‘Create Sale’ to step 6 (Looping step) instead as below?

 

If so, I tried that and get the following error:

Many thanks,

Darren


Hey there, ​@DarrenRodman 👋

Seems like the error is occurring as the value selected from the Looping step is the Deal to Line Item value rather than a valid SKU. I spotted that you also reached out to our Support team who suggested:

In the "Create Loop From Line Items" step, under "Add value set", you would add the fields you need for each line item, such as:

  • SKU
  • Quantity
  • Unit Price
  • (And any other relevant fields, like Product Name, Discount, etc.)

These fields will now be available for use within the loop (i.e., in Step 6 and beyond).

Which would allow you to then map a valid SKU to that SKU field however, the Find Line_item action seems like it would only return a single line item, not multiple line items. So I don’t think it would pass multiple line items to the looping action.

Instead, I think you’d want to put the Create Sale action before the loop, then have an Update Sale action inside the loop that adds the additional line items to it, and remove the filter from the loop. That way the Zap would, in theory, create the sale and then loop through the different Deal to Line Item ids to find the relevant line item details (using a Find Line_item action in the loop) and update the sale to include each line item.

Can you give that a try and let us know how you get on? 


Hi ​@DarrenRodman, just checking in—were you able to get this sorted? 

Let us know if you still need any help with this at all. 🙂


Hi ​@SamB, thanks for the suggestions!

Unfortunately, I can’t even complete the ‘Create Sale’ stage pre-loop as it requires stuff like SKU, Price and Quantity in order to create - see attached.

I guess I could try using placeholder details at this stage, then add another step post-loop to remove that line, would that work maybe?

Thanks for the help!

 


Sorry that didn’t work as hoped, ​@DarrenRodman. Ah, in that case you’ll need to get the first item item so you can search for it’s information in HubSpot, then add it to the sale before running the loop to find and add the other line item details. Rather than attempting to remove it later.

To do that you could use a Formatter (Utilities > Line-item to Text) action to have the line items split into separate fields and select the Output Item 1 field which would give you the first line item.

For example:

7c261d7c8220e3a9e28ba17295ab5269.png
33219d6397cc56a961390611b88025fa.png
Use that Output Item 1 field in a Find Line Item (HubSpot) search action, and map the line item details it returns into the Create Sale action so that the first deal line item is found and added to the sale. Then, in the looping action, you’d have just the Deal to Line Item field values mapped and use a Filter that’s set to only allow the loop to continue if it’s not the first loop iteration (as that information for the first line item will have already been added to the sale):

30fcf877349ab474741d01bb7002c674.png
That should ensure that the Update Sale action (that’s run after the filter in the loop) will only add the line item information that hasn’t already been added to the sale. 

So the order/placement of those actions would be like this:

9e37b6650b5d34a223f725e07ed30581.png

Can you give that a try and let me know if that does the trick?


Hi ​@SamB,

Thanks very much, I’m just trying to give that a go, but it seems the ‘Update Sale’ Cin7 Core action doesn’t actually let you add line items to an existing order annoyingly!

So my current thought process is to use a combination of your suggestion of Formatter (Utilities > Line-item to Text) above (which is a great tool by the way, thanks!) along with maybe a table or spreadsheet, post-loop, to collate a list of all the SKUs, their quantities and prices in one place, then reference them altogether in the ‘Create Sale’ action at the end of the chain.

I’ve tried playing around with a Google Sheets table after the loop, but I can only get it to pick up the first SKU, rather than collate all the looped data and then update the sheet - see attached current attempt with this.

Is there something in this where collating all looped data in one place would help do you think?

Thanks,

Darren


How frustrating, ​@DarrenRodman—so sorry! I didn’t realise the Update Sale action didn’t allow for the line items to be updated. 😕

Ooh yes! Your idea of storing the information in a spreadsheet could work. 🤔 You’d want to have a single spreadsheet row created in each loop though, rather than creating multiple spreadsheet rows each time. And then you’d have the filter check to see if it’s the last loop and if it is, it would search the spreadsheet to get all the relevant rows, so it can add them into the sale that’s created. Like this:

fa1bead47d864479d506f4a0a417d527.png

Can you give that a try and let me know whether that sorts it?