Power Automate

Translated from the Spanish original. Read in Spanish

Power Automate offers a wide range of out-of-the-box (OOTB) features, but sometimes you need more flexibility and complexity to achieve certain goals. Below are a few examples of how to use complex expressions to extend what Power Automate can do.

Get all the rows created today in Dataverse

To find every row created today in a Dataverse table, we can use an XML query.

<fetch mapping='logical'>
   <entity name='table_name'>  
      <attribute name='column_name'/>
      <attribute name='createdon'/>
       <filter>
           <condition attribute='createdon' operator="on" value='@{formatDateTime(utcNow(),'MM/dd/yyyy')}' />
         </filter>
   </entity>  
</fetch>

Manipulate strings to get the first name from an email

Power Automate has no regular expressions (Regex) OOTB, but you can manipulate strings to get similar results, such as extracting the first name from an array of emails.

slice(items('for_each_user'),0,IndexOf(items('for_each_user'),'.'))

Capitalise the first letter of the name

Once you have the first name, you can capitalise its first letter with the following code:

concat(first(toupper(outputs('Get_First_name'))),substring(outputs('Get_First_name'),1,sub(length(outputs('Get_First_name')),1)))

If you need to share or review a specific Flow, you can build a direct link to the Flow run with this expression:

concat('https://us.flow.microsoft.com/manage/environments/', workflow()?['tags']?['environmentName'], '/flows/', workflow()?['tags']?['logicAppName'], '/runs/', workflow()?['run']?['name'])

Using filters to combine multiple conditions

You may need to apply filters with several conditions inside an “Apply to each”. Instead of several control actions, use the following expression with multiple conditions:

@or(equals(item()?['Operation'], 'FileModified'),equals(item()?['Operation'], 'FileRecycled'),equals(item()?['Operation'], 'FileCheckedIn'),equals(item()?['Operation'], 'SharingRevoked'))

Using if statements instead of control actions

Where you would normally use control actions, you can use an if statement instead to simplify your workflow:

if(greaterOrEquals(outputs('Get_First_name'),"Juan"), 'Es Juan', 'No es Juan')

These examples show how you can use complex expressions to improve and customise your Flows in Power Automate. With a bit of creativity, the possibilities are almost endless.

Maximiliano Díaz Doglia

AI Platform Engineer & Full-Stack Developer
Building Enterprise Integrations & Automations