Question

How can I return line items from a sub-zap?

  • 2 September 2023
  • 9 replies
  • 67 views

Badge

It seems like Zapier flattens line items in the “return from sub-zap” step. So if I have line items like { name, age }, I can only return names and ages arrays.

 

I would then have to rebuild the line items in the parent each time I use the sub-zap, which means the sub-zap isn’t very reusable.

 

Is this correct? Is there another way to be able to re-use a “Code by Zapier” step that returns line items?


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

9 replies

Userlevel 7
Badge +14

@graemian 

I’ve offered to help if you can provide screenshots, so I will wait for you to provide those to add context, thanks.

Badge

I’m not asking you to “evaluate and advise about possible solutions”, just to answer the simple questions I have asked.

 

This is like asking a hardware store assistant if a particular drill bit can be used to drill in wood and having him refuse to answer the question unless I show him a blueprint of the house I’m building.

Userlevel 7
Badge +14

@graemian 

Ok, well unfortunately without screenshots with how the Zap steps are configured, I’m limited in my ability to evaluate and advise about possible solutions.

Badge

No you don’t. I’ve provided all the necessary context.

Userlevel 7
Badge +14

@graemian 

We would need to see screenshots with how your Sub-Zap is configured to have proper context.

Badge

Even though “Zapier pre-parses objects into their individual array data points”, the line item context is retained within a single zap. So if you have the name-age line items I originally described, they are inserted into a spreadsheet as expected:

 

Name, Age

Joe, 42

Mike, 16

 

 

When line items are generated by a sub-zap, you are forced to provide an “Output / Return Value” for each individual array. So now you have a name and age array. The line item context is lost. If you now try to insert into a spreadsheet, you get 1 row with the full set of values:

 

Name, Age

Joe Mike,42 16

Userlevel 7
Badge +14

@graemian 

That is not just a Sub-Zap issue.

Zapier pre-parses objects into their individual array data points which is why you are experiencing the data formatting behavior.

The reason I ask the question is so that we can have proper context to be able to evaluate and advise on the Zap step design as there may be other approaches, but that depends on us knowing the step logic, apps involved, and app trigger/actions involved.

 

 

 

Badge

I could, but my question could surely be answered in the abstract also? 

 

Providing screenshots and context would be long and painful (for both you as a reader and me as a writer). I’ve tried to describe the essence of the problem in my original question with a vastly simplified example.

Userlevel 7
Badge +14

Hi @graemian 

Good question.

Can you provide more context about the steps of the Zap you are trying to configure and how you are trying to use line items?

Screenshots will be helpful for us.