As we all know that Microsoft Flow is also known as Power Automate.

So, it has some limitations as well. Like Request limit, Flow limits, etc. to know more about Limits and configuration in Power Automate,, click here.

Another important point about power automate is that it is priced based on the number of times the flow has been triggered.

So, today we will learn how can we restrict/filter our power automate trigger.

Here is the scenario, I have a custom entity(Blog Note) of activity type and I want my power automate to trigger on create of blog note record when it’s is created from the Contact entity.

Now, under the timeline section, I can see an extra activity entity named Blog Note under Account, Contact, Lead, and so on.

I have the power automate ready with me, which triggers whenever a record is created within the Blog Notes entity from any entity like account, contact, lead, and so on.

I want to restrict my flow run so that it triggers only when a user creates the blog notes from the Contact entity. If a blog notes is created from some other entity like account or lead then the flow should not trigger.

To handle this we need to go to the trigger step(Trigger on create of BlogNotes) setting.

Go to – trigger step Settings
Added the Trigger Condition

This is how we check if the regardingid is a contact entity then only the power automate trigger else it won’t.

I hope this helps!

Learning Power Automate – Check null for a variable

Today, we will learn how to check an empty value on a variable under Power Automate.

I had a requirement where I need to push my Lead record data from Dynamics CRM to another application.

To fulfill this requirement, I thought of going with power automate. Which would trigger whenever a record is created under the Lead entity and then push the data to another application.

Here I have a field Due Date which is an optional field on a form. So now it is a user who chooses to enter data or not.

I have a child flow where I need to pass the data of Due Data as well. Below is the JSON schema for Child Flow. We can see that the due date is of string type, therefore if we pass null value it would throw us an error: Invalid type. Expected String but got Null

JSON Schema

To handle this scenario, we can use an empty expression:

syntax: if (empty(duedate), ”, duedate)

expression used to check field(duedate) was empty:

if (empty(string(triggerOutputs() ? ['body/duedate'])), '', triggerOutputs() ? [' body/duedate'])

How the expression work is it checks whether the field is empty or not, which means if the value is null or empty then it returns true which will pass not null. This is accepted as a string. Else, if the field contains a value then it would pass the field value.

Hope this help!