Question

Hubspot loop line items - "your run is pending" error

  • 6 February 2023
  • 8 replies
  • 115 views

I’m trying to create a summary field in Hubspot that basically concatenates all the line items of the deal into one field that I’m going to push back up to a deal summary field. I’ve got the trigger setup to start when a deal is moved to won.

 

Zap steps:

  • I then go look up the associated line items
  • I count how many there are (so I have a way to stop the loop) then
  • I start the loop,
    • it goes and finds the line items (one by one - each loop)
    • It then puts them into a digest field
      •  
        • which is constrained to publish after the loop has reached the count from the prior calculation
    • Then I used the filter to push the final summary field (after all the loops have completed) 
    • And then I update the field in hubspot. 

It triggers, and runs until the last loop, I keep getting this error. 

 

 

How do I get this to work? Should I be using a digest for this or is there an easier way? Also when I’m using the filter with the loop, is there a different way to let it move past the last loop and so that I only have to update the hubspot summary field one time? 

 

 

Here’s the whole zap - all the formatter stuff is just to calculate the number of line items so I can use it in the loop. 

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

8 replies

Userlevel 7
Badge +14

Hi @DWildcatters 

Good question.

We’d need to see screenshots with how the Digest in Step 9 and Filter in Step 10 is configured, thanks.

@Troy Tessalone I’ve actually gotten it to work but I don’t believe the digest is the right way to go about doing this. Can you let me know your thoughts? Ultimately I just want it to loop through the line items, for each line item, append a few values from it to a local variable. Then once the filter is true, update a hubspot field with that variable. But i only want it to store the values for the same loop.

 

After I initially got this working with digest, I realized that it just appends forever so instead of just pushing the 4 line item worth of data, it pushed all the line items for that loop that I’ve ever run (even while I was testing) and I can’t find a way to clear or reset that value. So I’ve now changed that to storage and at the very end of the workflow it's supposed to remove those values (at least that’s what I’m trying to do with this function below). This doesn’t appear to be working however as I only get the last line item value (4 times - the number of times the loop runs) in the final summary field, not 4 unique values from each line item reference. 

Please help me fix this! How do I loop through, find the values I want, and append them to the varibale. Then at the end of the loop when the filter is met for last loop, push the concatenated values (ie the variable) into the hubspot field. 

 

 

Here’s the new steps with details

Overall Workflow/loop

 

Userlevel 7
Badge +14

@DWildcatters 

NOTE: You may want to add a Delay After Queue step at the start of your Zap in case the Zap can be triggered multiple times at or around the same time, especially if you are using the same Storage Key.

https://zapier.com/help/create/customize/add-delays-to-zaps#delay-after-queue

 

If you are manually testing the Looping step, then only the first loop iteration will be available.

 

Make sure to read the description for this field in Step 11.

 

 

FYI: You can likely use 1 Code step to replace multiple Formatter steps to further optimize the Zap Task usage.

 

@Troy Tessalone What is the best way/how is one supposed to loop through values and concatenate them into a single field using zapier? 

 

I realize most of this could be done using the code feature but I’m not a dev (which is why I’m paying zapier) yet y’all have made it incredibly difficult to do even the most basic things. Like looping through a list and concatenating it into a single field. Please let me know how you would recommend doing this workflow as I’ve been battling this for a long time and I don’t feel like I’m getting anywhere. Is storage the only way to store output data from zaps to be used later in that same zap or is there another way? Again, this doesn’t need to be a global variable or anything like that, just something that I can use for the duration of the zap and then goes away or gets cleared at the end. It doesn’t appear that storage is working for this. 

Userlevel 7
Badge +14

@Troy Tessalone

To clarify, I don’t work for Zapier, but I am a Certified Zapier Expert: https://zapier.com/experts

 

Did you adjust this?

Make sure to read the description for this field in Step 11.

 

@Troy Tessalone apologies, this is why i’m not a dev, bc i don’t have the patience for coding. What should I change on the step/screenshot that you tagged? I don’t understand the description/documentation below or how it works when you’re dealing with this funtion inside a loop. 

It says use % but how does it know which values to use in place of the % when i’m having to create these in a loop each time? 

I’m all ears on this one though. 

Here’s what the output looks like when i use the % as placeholders. I clearly don’t understand how they’re describing using this feature/tool. This would be the desired output if the % signs were the lookup values from each of the line items I want it to pull during the loop. But I don’t know how to make it do that. Please let me know if you have any ideas around how to make it actually work

 

 

Userlevel 7
Badge +14

@DWildcatters 

Looks like you are missing the s after the %s as indicated in the field description.

 

Full description:

 

 

Items from the list will be combined together into a single value with this format.
Use %s as a placeholder for each list item.

For example:

  • If your list has two items "1234" and "6789"
  • And your format is "number %s, "
  • The output will be: "number 1234, number 6789" .