Skip to main content
Best answer

How do I update child objects based on conditions and skip steps in Zapier for custom objects?

  • 19 July 2024
  • 3 replies
  • 19 views

I have a parent-child relationship with two custom objects. for each parent object, it can have zero or more child objects, each with a name that is unique within the set of child objects for that parent.
I would like to create a zap that updates the parent and then updates each child, with different children having different fields that need to be updated. As an example, let us say that the parent is Basket__c and the children are Fruit__c with the fields Name, SegmentCount__c, Peeled__c, RipeOnDate__c, Seedless__c, and BasketId__c
For Name == Banana I want to update Peeled__c and RipeOnDate__c but for Name == Grapefruit I want to set SegmentCount__c and for Name == Orange I want to set SegmentCount__c and Seedless__c

Different Basket__c objects have different collections of Fruit__c in them.

It is easy to use Find Record to find a Fruit__c with a given BasketId and a given Name and if it exists I can update it.  But if it doesn’t exist I want to skip the update step and move on to the next kind of Fruit__c

Is it possible to skip steps if a filter fails but continue rather than stopping?  Is it possible to specify a Path split that rejoins?
 

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

3 replies

Userlevel 7
Badge +14

Hi @chris_wandrian 

Here are some resources to explore:

Looping can be used to iterate: https://zapier.com/apps/looping/help

Sub-Zaps can be used reuse other Zaps within a Zap: https://help.zapier.com/hc/en-us/articles/8496308527629-Build-reusable-Sub-Zaps

Paths can be used route: https://help.zapier.com/hc/en-us/articles/8496288555917

With Webhooks you can chain Zaps together.

  • 1:1
  • MANY:1
  • 1:MANY

 

Hi Troy,

Thanks for your suggestions.

With Paths, I could have one branch that updates a record if the record name exists, and then specify another branch as “Always Run” which is the no-op for that record name but continues on to the next name? I could do that a couple of times but apparently the maximum nesting is 3 levels.

With sub-zaps a call to it can have as many paths in the sub-zap as we like, and at the end all executions return to the parent zap?  That seems interesting, if a little unwieldy to manage in the UI but at least the parent zap would look clean.  I’m guessing the total of 100 steps per zap includes all of the steps in the sub-zaps

With Looping could I take my current record name by record name pipeline and change it like so:

  • Find Child Records
  • Create Loop From Line Items (pick the Name field from the Child Records to loop on)
  • Find Record with ParentID and Name = LoopValue as the search fields
  • Path that has Name=X, Name=Y, Name=Z rules
  • Appropriate Update Record step under each path

When the looping over the child records is complete, how will the zap continue?
How do I specify which steps after the loop step are within the loop and which steps are the continuation of the zap flow after the loop?
If only one action is allowed in the loop, I guess I could make it a sub-zap?

Userlevel 7
Badge +14

@chris_wandrian 

There can be multiple action steps after the Looping step.

 

When the looping over the child records is complete, how will the zap continue?

Depends on how the Zap steps are designed.

There is no aggregator option.

But you can follow the screenshots suggestion.