cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Trigger expression on when a record is created to look at parent entity column value

Hi, I don't know if this is possible but I am looking to set a trigger expression on when a record is created so that the flow will only run /execute when a field in its parent entity is a certain value.

I've done the usual set up of creating a compose action to add the column I want in - but to pick up that column I've had to add an additional get Records action called 'Get Starter Leaver records' that points at the parent entity. This action is added after 'When a record is created' action because the column I want to target in the compose action is in the parent entity. This is where the issue arises.

 

 

So in my flow I have the following action  (in order listed)

 

When a record is created

Get Starter Leaver Records

Compose

 

 

In the 'When a record is created action' I've added the following trigger  expression:

@equals(triggerBody('Get_Starter_Leaver_Records')?['crd19_sendappapproved'],true) 

 

As you can see, the sendapproved field is targeted in the get records action called 'Get_Starter_Leaver_Records' - that I added after the 'When a record is created' action in the flow.

 

But it doesn't work because the code in the compose action is now  @body and not @triggerBody:

 

"inputs": "@body('Get_Starter_Leaver_Records')?['crd19_sendappapproved']"
 
I believe this is due to the compose action not being directly under the 'When a record is created' action, which it can't be as I need the aforementioned get records action to get the parent entity column /value.
Is there a way round this?
 
 

 

 

 

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Trigger expression on when a record is created to look at parent entity column value

Hi @Darren1372,

 

If you search dynamic content in the right bar for "Send App Approved", it will appear two dynamic content to select, for example:

Annotation 2020-01-08 102934.png

 

If it not work, you can input the following expression directly:

@triggerBody()?['crd19_sendappapproved']

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Helper I
Helper I

Re: Trigger expression on when a record is created to look at parent entity column value

Hi v-lits-msft I added the expression 

 

@triggerbody()?['crd19_sendappapproved']

 

and updated the trigger as:

 

 @equals(triggerbody()?['crd19_sendappapproved'],true)  - the field is a two option type - but it still didn't work.

 

I even tried the full path to the parent entity:

In compose Action:

 

@triggerbody('Get_Starter_Leaver_Records')?['crd19_sendappapproved'] 

 

And then in the trigger:

 

@equals(triggerBody('Get_Starter_Leaver_Records')?['crd19_sendappapproved'],true)

 

Still no joy. Any ideas?

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (6,926)