Filter rows and Trigger Conditions in Power Automate


Filter rows and Trigger Conditions can be used to specify the condition on which the trigger should fire. This makes sure that we do not exceed flow execution limits.

Power Automate Licensing – Power Platform Requests

Power Automate Limits and Configuration

In the case of our Dataverse trigger “When a row is added, modified or deleted” we can make use of either Filter rows or Trigger Conditions, as we have both options available.

We’d be using Trigger Conditions for those triggers where we do not have additional property to specify the filter condition.

E.g. we want the flow to run only on a specific file in a library or based on the extension of the file as nicely explained here

https://tomriha.com/trigger-power-automate-flow-only-on-specific-file-in-a-library/

https://www.enjoysharepoint.com/trigger-conditions-in-power-automate/

Now out of curiosity, we tried specifying both Filter rows and Trigger conditions to see how it behaves.

Here for the same trigger we have specified Filter Rows as below

address1_city eq ‘Ahmedabad’

And Trigger Conditions as below

@equals(triggerOutputs()?[‘body/companyname’], ‘MS’)

During our test, we observed that the trigger is firing only when both the conditions or expressions, specified in Filter Rows as well as Trigger Conditions are true.

So basically it will only fire for those rows or records having Company as MS and City equal to Ahmedabad.

It will not fire if either of Filter Rows or Trigger Conditions expression evaluate to be false.

Hope it helps..

Advertisements

Fixed – Unable to process template language expressions for trigger. In the template language function ‘convertToUtc’, the value provided for the time zone id ‘Gulf Standard Time’ was not valid while using Delay Until property– Power Automate


Recently while using Delay until property of the trigger, in one of the flows, we got the below error

“Unable to process template language expressions for trigger ‘When_a_row_is_added,_modified_or_deleted’ at line ‘1’ and column ‘16344’: ‘In the template language function ‘convertToUtc’, the value provided for the time zone id ‘Gulf Standard Time’ was not valid. ‘.”

Usage of Delay until is nicely explained here by Debajit –

https://debajmecrm.com/how-to-delay-a-power-automate-flow-execution-till-a-specified-date-and-time/

https://debajmecrm.com/replicate-dynamics-365-workflow-timeout-wait-condition-in-microsoft-flows/

 

Delay until = convertToUtc(‘2022-05-16T17:22:00′,’Gulf Standard Time’)

It turns out that Gulf Standard Time is not a valid time zone id.

Changing it to Arabian Standard Time resolved the issue for us.

i.e.

convertToUtc(‘2022-05-16T19:22:00′,’Arabian Standard Time’)


Also check – https://nishantrana.me/2022/01/19/how-to-use-do-until-and-delay-in-power-automate/

Hope it helps..

Advertisements

Fixed – Invalid template. Unable to process template language expressions in action. Template language expression cannot be evaluated: the template action is not defined in the current scope (Power Automate)


While testing a cloud flow in Power Automate, for one of the actions, we got the below error

Unable to process template language expressions in action ‘Update_a_row’ inputs at line ‘0’ and column ‘0’: ‘Template language expression cannot be evaluated: the template action ‘Do_until’ is not defined at current scope.’.


We were getting the error because we were referring Current Iteration Index of Do Until control, which was inside Scope 1, in the Update a Row action of Scope 2, i.e. outside the scope of Do Until control.

Scopes – https://nishantrana.me/2022/05/10/d365-implement-try-catch-finally-in-powerautomate/

The way we resolved it was to initialize a variable, setting it inside the Do Until action with the current iteration index and then referring it inside Scope 2.

Do Until – https://nishantrana.me/2022/01/19/how-to-use-do-until-and-delay-in-power-automate/

Hope it helps..

Advertisements

How to – Use Do until and Delay in Power Automate


Let us take a simple example to understand the usage of the Do unit with Delay control in Power Automate.

“When a Case Record’s Priority is updated to High until the case is resolved we want to perform certain action e.g. send a notification email or call an action etc. every 2 minutes or so.”

This is how the final flow looks like –

First is the trigger, when the case record is modified, i.e. priority code field with value as 1.

Next, initialize a Boolean type variable as false, this will be used within the Do until loop condition.

  • Next, add the Do until control with the condition – ConditionMet i.e. the variable is equal to true.
  • Followed by Delay action, here we have specified a 2-minute delay.
  • Next, we are retrieving the same record to check the condition, this is required to get the updated value within the loop.
  • Condition is – is the case resolved? i.e. Status is equal to 1.
  • If Yes then we are setting the variable as true to come out of the do until loop.
  • If No then we perform any action, like send an email notification, reminder or call any action, etc.

The Current Iteration Index of Do unit holds the value of the current index starting from 0. Here we are updating the case title with the index just for testing.

To see it in action, let us Test the flow.

Updating the priority of the case to high triggers the flow.

After a delay of 6 minutes, we can see the Case Title updated with the current index i.e. 2 as it has iterated 3 times starting from 0.

Let us now resolve the case.

We can see our flow successfully completed after the 4th iteration after the case is resolved.

Also refer –

https://techwizard.cloud/2018/05/20/microsoft-flow-mystery-of-do-until-loop/

https://www.futurelearn.com/info/courses/cloudswyft-msft-dynamics-365-power-platform-auto/0/steps/208142

Hope it helps.

Advertisements

Solved – Flow run timed out. Please try again in Power Automate (Microsoft Flow)


While testing one of the flows which was having “Do until” action in it, we ran across the below error.

Error – Flow run timed out. Please try again.

However, while navigating to the run history we can still see the flow running, and has run for over 30 minutes. That’s the default behavior.

Refer to this – https://powerusers.microsoft.com/t5/General-Power-Automate/Flow-run-timed-out/m-p/713628#M58900

Hope it helps..

Advertisements

Fixed – The API version ” is not valid for provider ‘Microsoft.BusinessAppPlatform’ – Action ‘Force_Sync_user’ failed error – Power Automate


Recently while testing a flow we got the below error message

The API version ” is not valid for provider ‘Microsoft.BusinessAppPlatform’ The supported list of API versions are: ‘2016-02-01, 2016-11-01, 2018-01-01, 2018-10-01, 2019-05-01, 2019-10-01, 2020-04-01, 2020-05-01, 2020-06-01, 2020-08-01, 2020-09-01, 2020-10-01, 2021-03-01, 2021-04-01, 2021-07-01’.

API Version is as the name suggests is the version of the API, as there could be discrepancies in the different versions of API with regards to the input and the output parameters or some other changes.

We were using the below template

Force Sync Azure Active Directory Group members to specified CDS instance

The existing Force Sync user action in the template was having the API version as blank.

The way we fixed it was by adding a new Force Sync user action and deleting the existing one.

The new version of Force Sync User action was listing down the Environment in the drop-down and also had the version number mentioned in it.

After making the changes, this time it ran successfully.

Also, check

https://nishantrana.me/2021/12/14/the-trick-to-force-trigger-user-sync-power-platform-dynamics-365/

https://nishantrana.me/2021/12/13/using-force-sync-user-to-sync-powerapp-crm-users-power-platform-dynamics-365/

Hope it helps..

Advertisements
%d bloggers like this: