Power Automate IF with Examples

In this Power Automate tutorial, we will discuss Power automate If expression. And also we will discuss the below examples:

  • Power automate if expression
  • Power automate if expression variable
  • Power automate if condition is blank
  • Power automate if get items is empty
  • Power automate if(equals)
  • Power automate if array is empty
  • Power automate if array contains
  • Power automate if another file is already there
  • Power automate if approved
  • Power automate if action fails
  • Power automate if attachment name contains
  • Power Automate if boolean
  • Power automate if body is empty
  • Power automate if expression boolean
  • Power automate if column equals
  • Power automate if cell is empty
  • Power automate if date is today
  • Power automate if date is less than today
  • Power automate if date is null
  • Power automate if day of week
  • Power automate if date is greater than today
  • Power automate if file exists
  • Power automate if field is blank
  • Power automate if file name contains
  • Power automate if folder exists
  • Power automate if field changed
  • Power automate if greater than
  • Power automate check if group exists
  • Power automate if integer
  • Power automate if list is empty
  • Power automate check if lookup is empty
  • Power automate if today is monday
  • Power automate if person field is empty

Power automate if Funtion

The Power Automate if Function is a fundamental function, which checks the expression or value, and returns true or false.

For example: If (equals(2,3),’yes’, ‘no’), so this expression return no.

Power automate if expression variable

Here we will see an example of Power Automate if expression variable.

In Power Automate, select the Manually triggered Flow, then click on Add input and select Number field for 2 numbers.

Power automate if expression variable
Power automate if expression variable

Next click on the next step and select Initialize variable action, then provide the variable name, type as a string, and in value write the below expression.

if(equals(triggerBody()['number'],triggerBody()['number_1']),'Yes','No')
Microsoft Flow if expression variable
Microsoft Flow if expression variable

Now click on the save and to run the flow enters a value in the number field.

MS Flow if expression variable
MS Flow if expression variable

Now you can see if the expression returns No, because 12, and 13 are not equal.

MS Flow if expression variable
MS Flow if expression variable

Read How to convert word to pdf using Power Automate

Power automate if condition is blank

Here we will check if the field is blank or not in SharePoint using Power Automate or Microsoft Flow.

For this example, I will use the below SharePoint list i.e. Project List. Then we will check the last date is blank or not.

Power automate if condition is blank
Power automate if the condition is blank

Now we will check if the field is empty or not using condition action. So click on the Next step and select condition control action. Then provide the

  • value: Last date from dynamic content
  • Operator: is equal to
  • value: null ()
Microsoft Flow if condition is blank
Microsoft Flow if the condition is blank

Now click on Save and run the flow to create an item in the SharePoint list.

How MS Flow if condition is blank
How MS Flow if condition is blank

In my case the last date field is empty, so it returns true.

MS Flow if condition is blank
MS Flow if the condition is blank

Read Power Automate Compose

Power Automate if get items is empty

Here we will see an example of Power Automate if get items are empty.

For this example, we will take the below SharePoint list.

Power automate if get items is empty
Power automate if get items are empty

In Power Automate, select the Manually triggered Flow, then click on the Next step.

How Power automate if get items is empty
How Power automate if get items is empty

Select Get items action, then provide the site address, list name, and in the Filter query write the below query:

Rating gt '4'
How Power automate if get items is empty
How Power automate if get items is empty

Then initialize two variables of string type, so click on the Next step and select Initialize variable action. Then provide a variable name, and type it as a string.

Microsoft Flow if get items is empty
Microsoft Flow if get items is empty

Next, we will check the length of the value property of getting items, and the length could be 0 or more.

So click on the next step and select Condition control, then provide:

  • value: length(body(‘Get_items’)?[‘value’])
  • operator: is greator than
  • value: 0

Next in the if yes part of the condition, so click on add an action, and select Set variable action. Then select the variable name ‘isnotempty’ and then set the value as false(). Then in If no part of the condition, select set variable action and select the variable name as ‘isEmpty’ and in value add an expression as true()

How Microsoft Flow if get items is empty
How Microsoft Flow if get items is empty

Now click on save and run the flow manually. In this example, there are no items are in the list that has ratings greater than 4, so get items output value is null. So the condition is false it will run if no part.

MS Flow if get items is empty
MS Flow if get items are empty

Read Power Automate export SharePoint list to excel and send an email

Power automate if(equals)

Here we will see how to use the equal function in if function with Power Automate or Microsoft Flow.

In Power Automate, select the Manually triggered Flow, then click on the next step.

Power automate if(equals)
Power automate if(equals)

Next, we will initialize two string variable, if the two string is equal then it returns true else return false. So select initialize variable action, then provide the variable name, type as a string.

MS Flow if(equals)
MS Flow if(equals)

Now we will check the above two string is equal or not, so click on the next step and select Compose action. Then provide the variable name and in input write the below expression:

if(equals(variables('varString 2'),variables('varString')),'True','False')
Microsoft Flow if(equals)
Microsoft Flow if(equals)

Now click on Save and run the Flow manually and you can see the output in the compose action.

How Microsoft Flow if(equals)
How Microsoft Flow if(equals)

Read Power Automate delete all items in SharePoint list

Power automate if array is empty

Here we will see an example to check if the array is empty using Power Automate or Microsoft Flow.

For this example, I will use the below SharePoint list called Product list.

Power automate if array is empty
Power automate if array is empty

In Power Automate, select the Manually trigger Flow, then click on the Next step.

How Power automate if array is empty
How Power automate if array is empty

Select Get items action, then provide the site address, list name and in Filte query add the query i.e. Rating gt ‘4’.

Microsoft Flow if array is empty
Microsoft Flow if array is empty

Next, we will check the above array if the items are empty or not, so click on the next step and select compose action. Then in input write the below expression:

if(empty(body('Get_items')?['value']),True,False)
MS Flow if array is empty
MS Flow if an array is empty

Now click on save and run the flow and you can see there is no item above 5 ratings so get item body value is empty, it returns true.

How MS Flow if array is empty
How MS Flow if array is empty

Read The specified object was not found in the store Power Automate

Power automate if array contains

Here we will see an example of Power Automate if an array contains.

In Power Automate, select the Manually triggered flow, then click on the next step.

Power automate if array contains
Power automate if the array contains

Select initialize variable action, then provide the variable name, type as an array, and in value write the below array.

[
  {
    "Name": "Alex",
    "Age": "38",
"Department":"Finance"
  },
  {
    "Name": "Michel",
    "Age": "38",
"Department":"Finance"
  },
  {
    "Name": "Celia",
    "Age": "30",
"Department":"IT"
  },
  {
    "Name": "Ruby",
    "Age": "32",
"Department":"Finance"
  },
 {
    "Name": "John",
    "Age": "32",
"Department":"HR"
  },
 {
    "Name": "Maven",
    "Age": "28",
"Department":"HR"
  }
]
Power automate if array contains
Power automate if array contains

Then click on the next step and select Apply to each and select varArray from the dynamic content. Then click on the Add an action, and select condition control action. Then provide the

  • value: item()?[‘Department’]
  • Operator: contains
  • value: Finance
Microsoft Flow if array contains
Microsoft Flow if array contains

Now click on Save and run the flow manually, if Department contains finance then it returns true else it will return false. So object 1, the department contains Finance, so it returns true.

MS Flow if array contains
MS Flow if array contains

Read How to get email address from name in Power Automate

Power Automate if another file is already there

Here we will see an example of Power automate if another file is already there.

So here we will copy files from one library to another, and if the file is already there in folder 2, then we will create a file with a new name else copy a file to the folder.

Power automate if another file is already there
Power automate if another file is already there

Contract folder in the Documents library

How Power automate if another file is already there
How Power automate if another file is already there

In Power Automate, select the trigger ‘When a file is created(properties only). Then provide the site address and library name.

Microsoft Flow if another file is already there
Microsoft Flow if another file is already there

Now we will get files from another library, so click on the Next step and select Get files (properties only) action. Then provide the Site address and Library name.

How Microsoft Flow if another file is already there
How Microsoft Flow if another file is already there

Now we will filter the files if the file name of created file is equal to the filename of the existing file. So click on the Next step and select Filter array action. Then provide the below

  • From: value (get files (properties only)) from dynamic content.
  • value : Filename with extension (get files (properties only))from dynamic content.
  • operator: is equal to
  • value: Name (when a file is created) from dynamic content.
MS Flow if another file is already there
MS Flow if another file is already there

Then click on Add an action and select Condition control action, then provide the below

  • value: length(body(‘Filter_array’))
  • operator: is equal to
  • value :0
See also  How to get selected value from Slicer in Power BI

If the above condition is true then in if yes part of the condition, click on add an action and select copy file action. Then provide the site address, file to copy, Destination site address, Destination folder, and if another file is already there then select Fail this action.

If the above condition is false then in IF no part of the condition, click on add an action and select Get File content, then provide the site address and File Identifier provide the identifier of the trigger from dynamic content.

Then click on add an action and select Create file action and provide the site address, folder path, filename add the below expression and provide the file content from dynamic content.

How MS Flow if another file is already there
How MS Flow if another file is already there

Now click on save and create a file in the library, if the file is already there then it will create a file with a new name else it will copy a file to the destination library. This example is not there so it copy a file from one library to another.

if another file is already there using MS Flow
if another file is already there using MS Flow
if another file is already there using Flow
if another file is already there using Flow

It gets copied to the below folder in the document library.

if another file is already there using Microsoft Flow
if another file is already there using Microsoft Flow

Read Power Automate copy files with Examples

Power Automate if approved

Here we will see an example if the request is approved then we will send an email to the requestor.

So for this example, I have a created Leave request list, so when a user creates a leave request, then the manager will get an approval request. According to the response user will get an email automatically.

Power automate if approved
Power automate if approved

In Power Automate, select the When an item is created trigger. Then provide the site address and List name.

 if approved in Power automate
if approved in Power automate

Next, create start and wait for an approval, so click on the Next step and select Start and wait for an approval action. Then provide the Approval type select Approve/Reject-First To respond, Leave request by, Assigned to, and Details.

if approved in Power automate
if approved in Power automate

Next, we will send an email to the user based on the approver response, so click on the Next step and select Condition control action. Then provide

  • value: Response Approver response
  • operator: is equal to
  • value: Approve, that will automatically add apply to each action.

If the above condition is true then it will send an approved email to the user, so click on the Next step and select Send an email(V2) action, then provide the To, subject, and body.

Then click on add an action and select Update item action, then provide the site address and map the value from dynamic content, and in Approve field select yes.

If the above condition is false, then we will send a rejected email to the user, so click on Add an action and select Send an email(V2) action, then provide the To, subject, and body.

Then click on add an action and select Update item action, then provide the site address and map the value from dynamic content, and in Approve field select No.

Microsoft Flow if approved
Microsoft Flow if approved

Now click on save and To run the Flow create an item in the SharePoint list.

How Microsoft Flow if approved
How Microsoft Flow if approved

Your Manager will get an Approve notification in Teams like below:

Flow if approved
Flow if approved

Once the flow get the Approval status, flow will send an email and update the item.

MS Flow if approved
MS Flow if approved

So, the user will get an email like the below based on the response.

How MS Flow if approved
How MS Flow if approved

Read Microsoft Flow or Power Automate employee onboarding

Power Automate if attachment name contains

Here we will see an example Power Automate if attachment name contains.

So in this example, we will see when a new email arrives with an attachment, if the attachment name contains weekly then we will create a file in the Sharepoint library.

In Power Automate, select the When a new email arrives(V3) trigger. Then provide the folder where the email will arrive.

Power automate if attachment name contains
Power automate if attachment name contains

Now we will check the attachment name contains weekly, so click on the Next step and provide

  • value: Attachment name
  • operator: contains
  • value: Weekly

If the above condition is true then in the If yes part, click on Add an action, and select Create file action. Then provide the site address, Folder path, File name, and File content from dynamic content.

Microsoft Flow if attachment name contains
Microsoft Flow if attachment name contains

Now click on Save and to run the flow, send an email to the outlook folder.

Power automate if attachment
Power automate if attachment

Now you can see file get created in the SharePoint Document library.

MS Flow if attachment
MS Flow if attachment

Read Convert SharePoint list item to PDF using Flow or Power Automate

Power Automate if boolean

Here we will see how to check the boolean column in Power Automate.

So, for this example, we will use the delivered column(Yes/No column) of the project list in SharePoint.

Power automate if boolean
Power automate if boolean

In Power Automate, select the manually triggered Flow, then click on the next step.

Power automate if boolean
Power automate if boolean

Next, we will get items from the list, so select Get items action, then provide the site address, List name, and Top count as 100.

Microsoft Flow if boolean
Microsoft Flow if boolean

Next, we will check that delivered is equal to true, so click on the Next step and select condition control, then provide the below

  • Value: Delivered from dynamic content
  • Operator: is equal to
  • value: true(), that will automatically appply to each action.
MS Flow if boolean
MS Flow if boolean

Now click on Save and run the flow, you can see 2nd item is delivered so it returns true, else it will return false.

How MS Flow check boolean
How MS Flow check boolean

Read Power Automate Create a CSV Table

Power automate if expression boolean

Here we will see an example of Power Automate if expression is boolean.

So, for this example, we will be delivered a column(Yes/No) of the Sharepoint Project list.

How Power automate if expression boolean
How Power automate if expression boolean

In Power Automate, select the When an item is created trigger. Then provide the site address and list name.

Power automate if expression boolean
Power automate if expression boolean

Next, we will check the project is delivered or not, so click on the next step and select Compose action. Then in input provide the below expression:

if(equals(triggerOutputs()?['body/Delivered'],true), 'Delivered','Not Delivered')
Microsoft Flow if expression boolean
Microsoft Flow if expression boolean

Now click on Save and to run the flow create an item in the SharePoint list.

MS Flow if expression boolean
MS Flow if expression boolean

Now you can see the project is not delivered so it will return not delivered.

How MS Flow if expression boolean
How MS Flow if expression boolean

Read How to update SharePoint Multiselect column in Power Automate

Power automate if action fails

Here we will see an example of Power Automate if the action fails.

Now we will create a flow, that will send an email if the action fails in Power Automate.

In Power Automate, select the When a new email arrives(V3), trigger. Then provide the outlook folder where the email will receive and click on Show advanced option, then provide the subject filter.

Power automate if action fails
Power automate if the action fails

Click on the next step and select Create File action, then provide the site address, Folder path, Filename, and File content from dynamic content, that will automatically add Apply to each action.

Microsoft Flow if action fails
Microsoft Flow if the action fails

Now if the Apply to each action fails, then the flow will send an email that this flow fails. So click on the next step and select Send an Email(V2). Then provide the To, Subject, and Body of the email like below. Then click on more icons (…) in the action, select Configure run after.

Power automate alert if flow fails
Power automate alert if flow fails

Then select has failed from the options, when the flow will fail it will send a notification.

Microsoft Flow alert if flow fails
Microsoft Flow alert if flow fails

Now click on Save and to run the Flow send an email to the inbox and if the flow fails you will get a failed notification. To test the Flow I have added s to the folder path i.e. /Shared Documents.

MS Flow if action fails
MS Flow if the action fails

And in the outlook, we will get the below failed action email.

MS Flow alert if flow fails
MS Flow alert if flow fails

Read How to create a word document from a template in Power Automate

Power automate if body is empty

Here we will see an example of Power Automate if the body is empty.

In Power Automate, select the Manually triggered Flow, then click on the Next step.

Power automate if body is empty
Power automate if the body is empty

Select the compose action, then in input provide the empty array.

Power automate if body is empty
Power automate if body is empty

Next click on the next step and select Initialize variable action, then provide the variable name, type as boolean, and in value write true.

Microsoft Flow if body is empty
Microsoft Flow if body is empty

Now click on the Next step and select condition control, then provide the below information:

  • value : true
  • operator: is equal to
  • value: empty(outputs(‘Compose’))

If the above condition is true, then click on add an action and select set variable action and select a variable name, and set the value as true.

And if the above condition is false, then click on add an action and select set variable action and select the variable name, and set the value as false.

How Microsoft Flow if body is empty
How Microsoft Flow if body is empty

Now click on save, and run the flow manually. And you can see the block is empty so it returns true.

MS Flow if body is empty
MS Flow if body is empty

Read Power Automate Create File

Power Automate if column equals

Here we will see an example of Power Automate if column equals.

So for this example, we will use the status column(choice) of the task Sharepoint list.

Power automate if column equals
Power automate if column equals

In Power Automate, select the ‘ When an item is created or modified‘ trigger. Then provide the site address and list name.

Power automate if field equals
Power automate if field equals

If the status value is completed then we will send an email, so click on the Next step and select condition control. Then provide the

  • value: Status value from dynamic content.
  • operator: is equal to
  • value: Completed

If the above condition is true, we will send an email(V2) action, then provide the To, subject, and body of the email.

Microsoft Flow if column equals
Microsoft Flow if column equals

Now click on save and to run the flow, create an item in the Sharepoint list.

MS Flow if column equals
MS Flow if column equals

Now the user will get an email of the task is completed.

MS Flow if field equals
MS Flow if field equals

Read Power Automate Replace

See also  Power Automate Trigger Conditions Examples

Power automate if cell is empty

Here we will see an example of Power Automate if the cell is empty.

So here we will use the product excel file and we will check the cell is empty or not. If empty then it returns true or else returns false.

Power automate if cell is empty
Power automate if the cell is empty

In Power Automate, select the Manually triggered Flow, then click on the Next step.

Power automate if cell is empty
Power automate if the cell is empty

Now we will fetch the data from the excel sheet, so click on the next step and select List rows present in a table. Then provide the Location, Documents Library, File, and table.

Microsoft Flow if cell is empty
Microsoft Flow if the cell is empty

Now click on the Next step and select Initialize variable action, then provide the variable name, type as boolean, and set the value as true.

How Microsoft Flow if cell is empty
How Microsoft Flow if the cell is empty

Check if the cell is empty in the category column, so click on the Next step and select Apply to each action, provide the value to the field. Next, click on the next step and select condition control, then provide the below

  • value: empty(items(‘Apply_to_each’)?[‘Category’])
  • operator: is equal to
  • value: true()

if the above condition is true, in if yes part, click on Add an action and select Set variable action. Then provide the variable name and in value is true.

And if the condition is false, then in if no part, click on Add an action and select Set variable action. Then provide the variable name and set the value as false.

MS Flow if cell is empty
MS Flow if the cell is empty

Now click on Save and run the flow, if the cell is empty, it will return true. In this example the third cell is empty, so it returns true,

Flow check if cell is empty
Flow check if cell is empty

Read How to call a flow from another flow in Power Automate

Power Automate if date is today

Here we will see an example of Power Automate if the date is today.

So, for this example, we will use the Event list, and if the date is today, then it will send an email to the user.

Power automate if date is today
Power automate if the date is today

In Power Automate, select the Manually trigger flow, then click on the next step.

Power automate if date is today
Power automate if the date is today

Now we will retrieve items from the SharePoint list, so click on the next step and select Get items action. Then provide the site address, List name, and Top count as 100.

Microsoft Flow if date is today
Microsoft Flow if date is today

Then click on the next step and select Apply to each action, then provide the value from the dynamic content. Next click on Add an action and select Condition control. Then provide the:

  • value:Event date from dynamic content
  • operator: is equal to
  • value: utcNow(‘yyyy-MM-dd’)

If the above condition is true then in the If yes part clicks on Add an action and select Send an email(V2) action. Then provide the To, subject, and body of the email.

MS Flow if date is today
MS Flow if date is today

Now click on Save and run the flow manually. If the event date is today then we will send an email.

MS Flow check if date is today
MS Flow check if date is today

So we will get an email for Team Meeting in Outlook.

How MS Flow check if date is today
How MS Flow check if the date is today

Read Power Automate Set Variable

Power Automate if date is less than today

Here we will see an example of Power Automate if the date is less than today.

In Power Automate, select the Manually triggered Flow, then click on the next step.

Power automate if date is less than today
Power automate if the date is less than today

Select Initialize variable action, then provide the variable name, type as a string, and in value provide a date, which we will compare with today’s date.

Power automate if date is less than today
Power automate if the date is less than today

Now we will check if a date is less than today, so click on the next step and select Compose action. Then in input provide the below expression:

if(less(variables('varDate'),utcNow('dd-MM-yyyy')),'date is less than today','date is not less than today')
Microsoft Flow if date is less than today
Microsoft Flow if date is less than today

Now click on Save and run the flow manually, and you can see the result in compose output.

MS Flow if date is less than today
MS Flow if date is less than today

Read Power Automate wait timer

Power Automate if date is null

Here we will see an example of Power Automate if the date is null.

For this example, we will use MS Form i.e. Feedback form, and Sharepoint List i.e. Feedback Survey.

Power automate check if date is null
Power automate check if date is null
Power automate if date is null
Power automate if the date is null

So here we will create a flow that will create items in the SharePoint List when a form is submitted. If the attended date output is empty then we receive an error.

Power automate if date field is empty
Power automate if the date field is empty
Microsoft Flow if date field is empty
Microsoft Flow if the date field is empty

To solve the above error, we will use an expression instead of using date directly. if the date is empty we will update the null and if it is not, then update the actual value.

In Power Automate, select the ‘When a new response is submitted’ trigger. then provide the Form id from the option.

MS Flow if date field is empty
MS Flow if date field is empty

Now click on the Next step and select Get response details, then provide the form id and response id from dynamic content.

 Flow if date is empty
Flow if the date is empty

Next, we will create an item in the Sharepoint list, so click on the Next step and select Create item action. Then provide the site address, list name, and map the field with the dynamic content. Then in the date field add the below expression.

if(equals(outputs('Get_response_details')?['body/re2da1ab493dd438dba07708ad26a908a'],''),null,outputs('Get_response_details')?['body/re2da1ab493dd438dba07708ad26a908a'])
MS Flow if date is empty
MS Flow if date is empty

Now click on save and run the flow submit the form. Now you can see flow ran successfully even if the date is null.

MS Flow check if date is empty
MS Flow check if date is empty

And you can see an item get created with the date field is empty in SharePoint List.

MS Flow check if date field is null
MS Flow check if date field is null

Read Power Automate update SharePoint list increment integer field

Power automate if day of week

Here we will see an example check if Power Automate if the day of the week.

So, we will create a flow that will check if the current day of the week is the weekend i.e. Saturday and Sunday, or weekdays.

In Power Automate, select the Manually triggered Flow, then click on the Next step.

How Power automate if day of week
How Power automate if the day of week

Select Initialize variable action, and provide the variable name, type as a string, and in value write the below expression:

utcNow()
Power automate if day of week
Power automate if day of week

Now we will check if the current date is the weekend or weekdays, so click on the next step and select Compose action. Then in input provide the below expression:

if(or(equals(dayOfWeek(variables('Current date')),0),equals(dayOfWeek(variables('Current date')),6)),formatDateTime(variables('Current date'),'dddd'),'weekdays')
Power automate check if day of week
Power automate check if the day of week

Now click on Save and run the flow manually, you can see that the current day is weekdays.

Microsoft Flow check if day of week
Microsoft Flow check if day of week

Read How to move emails to folder after 30 days using Power Automate

Power Automate if date is greater than today

Here we will see an example if the date is greater than today.

In Power Automate, select the Manually triggered Flow, then click on the Next step.

Power automate if date is greater than today
Power Automate if the date is greater than today

Select Initialize variable action, then provide the variable name, type as a string, and in value provide a date, which you want to compare.

Microsoft Flow if date is greater than today
Microsoft Flow if the date is greater than today

Now click on the next step and select Compose action, then in input provide the below expression.

if(greater(utcNow('dd-MM-yyyy'),variables('Date')),'is greater', 'not greater')
Microsoft Flow check if date is greater than today
Microsoft Flow check if the date is greater than today

Now click on Save and run the Flow Manually. As the current date is 10-03-2022, it will return is greater.

MS Flow check if date is greater than today
MS Flow check if the date is greater than today

Read Power Automate list rows present in a table filter query

Power automate if file exists

Here we will see an example of Power Automate if a file exists in SharePoint Library.

In Power Automate, select the Manually triggered Flow, then click on the next step.

Power automate if file exists
Power automate if file exists

Now we will retrieve files and filter the particular file, so click on the Next step and select the Get Files(properties only) action. Then provide the site address, Library name, and in the Filter query, write the below query to filter the weekly report.xlsx files.

FileLeafRef eq 'Weekly Report.xlsx'
Power automate check if file exists
Power automate check if file exists

Next, we will check if the length of the value is greater than 0, then the file exists else it does not exist. So click on the next step and select Compose action. Then in input, write the below expression:

if(greater(length(body('Get_files_(properties_only)')?['value']), 0),'File exists', 'File doesnot exist')
Microsoft Flow check if file exists
Microsoft Flow check if file exists

Now click on Save and run the Flow Manually. As there is no file that exists in the name of Weekly Report.xlsx, its returns file does not exist.

Microsoft Flow  if file exists
Microsoft Flow if file exists
MS Flow check  if file exists
MS Flow check if file exists

Read Power Automate Get Events into Excel

Power automate if field is blank

Here we will see an example of Power Automate if the field is blank.

So for this example, I will take the below Sharepoint list, i.e. Events.

Power automate if field is blank
Power Automate if the field is blank

In Power Automate, select the When an item is created, and provide the site address, and List name.

Power automate check if field is blank
Power automate check if the field is blank

Next, initialize variable action, then provide the variable name, type as boolean, and set the value as true.

Microsoft Flow check if field is blank
Microsoft Flow check if field is blank

Now click on the Next step and select condition control, which will check the Event date filled is empty or not. Then provide the

  • Value: Event Date from the dynamic content
  • Operator: is equal to
  • Value: null()

If the above condition is true, so select set variable action, then select the variable name, and set value as true.

And if the condition is false, so select set variable action, then select the variable name and set the value as false.

MS Flow check if field is blank
MS Flow check if field is blank

Now click on Save and to run the flow create an item in the Sharepoint list.

MS Flow if field is blank
MS Flow if the field is blank

So, it returns true as the event date field is empty.

Flow  if field is blank
Flow if the field is blank

Read Microsoft flow send email based on create date

Power Automate if today is monday

Here we will see an example of Power Automate if today is Monday.

In Power Automate, select the Manually triggered Flow, then click on the next step.

Power automate if today is monday
Power automate if today is Monday

Select Initialize variable action, then provide the variable name, type as a string, and in value provide the below expression:

utcNow()
How Power automate if today is monday
How Power automate if today is monday

Next, we will check if today is Monday, else it will return the current day, so click on the next step and select Compose action. Then in Input write the below expression:

if(equals(dayOfWeek(variables('Today date')),1), 'Monday', utcNow('dddd'))
Microsoft Flow  if today is monday
Microsoft Flow if today is Monday

Now click on save and run the Flow manually. As today is Thursday, so, it will return Thursday in compose output.

MS Flow  if today is monday
MS Flow if today is Monday

Read Power Automate or Microsoft Flow check day of week

See also  How to Set as Total in Power BI Waterfall Chart?

Power automate if field changed

Here we will see an example of Power Automate if the field changed in the Sharepoint list.

So for this example, we will use the below Tasklist, when task status gets changed the flow will send an email. And enable versioning of this list.

Power automate if field changed
Power automate if field changed

In Power Automate, select When an item is created or modified trigger. Then provide the site address and List name.

Power automate check if field changed
Power automate check if field changed

Next, we will use the Get changes for an item or a file action, which will return a boolean value if any field is changed in the List.

So click on the next step and select Get changes for an item or a file (properties only) action. Then provide the site address, List name, id, and in the Since field write the below expression. By using the Since field, we will compare the current item with the old version. As we want the current item so for this use the below expression.

sub(int(triggerOutputs()?['body/{VersionNumber}']),1)
Microsoft Flow if field changed
Microsoft Flow if field changed

Next, we will send an email if the status field changed. So click on the Next step and select condition action. Then provide the below

  • value: Has column changed: status, from dynamic content
  • Operator: is equal to
  • value: true

If the above condition is true, in the If yes part, click on Add an action and select Send an Email(V2) action. Then provide to, subject and body.

Microsoft Flow check if field changed
Microsoft Flow check if field changed

Now click on Save and to run the flow either create an item or modify the item. I changed the status field to complete.

MS Flow check if field changed
MS Flow check if field changed

Once the item changed we will get an email in outlook.

MS Flow  if field changed
MS Flow if field changed

Read Power Automate SharePoint Get Items Filter Query

Power automate if greater than

Here we will see an example of Power Automate if greater than.

In Power Automate, select the Manually triggered FLow, then click on the Next step.

Power automate if greater than
Power automate if greater than

Select initialize variable action, then provide the variable name, type as integer, and in value provide a numeric value. Similarly, initialize another integer variable and provide a numeric value.

Microsoft Flow if greater than
Microsoft Flow if greater than

Now we will check which value is greater, if num 2 is greater than num 1, then the return is greater else the return is not greater.

So click on the next step and select Compose action. In input write the below expression:

if(greater(variables('num 2'),variables('num 1')),'is greater', 'is not greater')
Microsoft Flow check if greater than
Microsoft Flow check if greater than

Now click on Save and run the flow manually, and you can see the output in compose action.

MS Flow check if greater than
MS Flow check if greater than

Read Power Automate send email to SharePoint group

Power Automate check if group exists

Here we will see an example of Power Automate check if group exist in SharePoint site.

In Power Automate, select the Manually triggered Flow, then click on the Next step.

Power automate check if group exists
Power automate check if group exists

Now initialize two variables one variable to store group and another variable group exist or not.

So select two initialize variable actions and provide the below information like below:

Power automate check if group exists in SharePoint
Power automate check if the group exists in SharePoint

We will send an HTTP request to SharePoint, to get the group if exist based on the group name. So click on the Next step and select Send an HTTP request to SharePoint action. Then provide the site address, Method as gets, and provide the below Uri:

/_api/web/sitegroups?$select=Title&$filter=Title eq 'EnjoySharePoint Owners'
Microsoft Flow check if group exists in SharePoint
Microsoft Flow check if the group exists in SharePoint

Next click on the Next step and select Set variable action. Then select ArrayGroup variable, then provide the below expression:

body('Send_an_HTTP_request_to_SharePoint')['d']['results']
Microsoft Flow check if group exists
Microsoft Flow check if the group exists

Now if the length of the array of the group is greater than 0, then the group exists. So click on the Next step and select Condition action. Then provide

  • value:length(variables(‘ArrayGroup’))
  • operator: is greater than
  • value:0

If the above condition is true then in the if yes part, set the GroupExist variable as true, and in if not part set the variable as false.

Power automate if length greater than
Power automate if length greater than

Now click on save and run the flow manually. As we have group ‘EnjoySharePoint Owners’ so it returns true.

MS Flow check if group exists
MS Flow check if group exists
MS Flow check if group exists or not
MS Flow check if group exists or not

Read Power Automate remove characters from a string

Power Automate if integer

Here we will see an example of Power Automate if integer.

So here we will create a flow that will check whether a string is an integer or not.

In Power Automate, select the Manually triggered Flow, then click on the next step.

Power automate if integer
Power automate if integer

Next, initialize two-variable of string and boolean type like below.

Power automate check if integer
Power automate check if integer

Next, convert the string value to an integer, so click on the next step and select a compose action. Then provide the below expression:

int(variables('varnum'))
MS Flow check if integer
MS Flow check if integer

Now set the variable ‘isInteger’ to false, so click on the next step and select Set variable action. then select the variable name and set the value as false.

How MS Flow check if integer
How MS Flow check if integer

And also we will set the configure run after and set it to has failed. So click on the more icon and select Configure run after. And then select has failed.

How Power Automate check if integer
How Power Automate check if integer

Next, we will check if the condition isInteger is true or false, so click on the next step and select Condition action. Then provide

  • Value : IsInteger from dynamic content.
  • operator: is equal to
  • value : true
How Power Automate  if integer
How Power Automate if integer

Next, set the configure run after properties ‘is successful’, so click on the more icon and select configure run after. Then select is successful and is skipped.

Microsoft Flow  if integer
Microsoft Flow if integer

Now click on save and Run the flow manually. Flow for numeric value:

Microsoft Flow check if integer
Microsoft Flow check if integer

Flow for non-numeric:

 Flow check if integer
Flow check if integer

Read Power Automate Array Variable

Power Automate if list is empty

Here we will see an example Power Automate check if SharePoint list is empty.

So for this example, we will use the below SharePoint list i.e. Leave Request List.

Power automate if list is empty
Power automate if the list is empty

In Power Automate, select the Manually triggered Flow, then click on the Next step.

Power automate if list is empty
Power automate if list is empty

Select get items action, then provide the site address, list name and Top count as 100.

Power automate check if list is empty
Power automate check if list is empty

Now we will check the list is empty or not, if the length of the get items value is 0 then it is empty. So click on the next step and select Compose action, then in input write the below expression:

if(equals(length(outputs('Get_items')?['body/value']), 0),'true','false')
Power automate if list rows is empty
Power automate if list rows is empty

Now click on Save and run the flow manually. As we have 1 item in the SharePoint list so it returns false.

Microsoft Flows if list rows is empty
Microsoft Flows if list rows is empty

Read Power Automate send email based on form response

Power Automate check if lookup is empty

Here we see an example of Power Automate check if the lookup field is empty.

So, for this example, we will use the SharePoint list i.e. Project List, so in this list, Assigned to is lookup column.

Power automate check if lookup is empty
Power automate check if lookup is empty

In Power Automate, select When an item is created trigger. Then provide the site address and list name.

How Power automate check if lookup is empty
How Power automate check if lookup is empty

Next, initialize variable action, Then provide the variable name, type as boolean, and set the value to true.

Microsoft Flow check if lookup is empty
Microsoft Flow check if lookup is empty

Now we will check lookup field is empty or not, so click on the Next step and select Condition action. Then provide the

  • value: empty(triggerOutputs()?[‘body/Employee_x0020_Name’])
  • operator: is equal to
  • value: true

If the above condition is true, set the variable ‘LookupFieldIsEmpty’ as true. If the condition is false set the variable ‘ LookupFieldIsEmpty’ as false.

Microsoft Flow check if lookup field is empty
Microsoft Flow check if lookup field is empty

Now click on Save and to run the flow create an item in the SharePoint list.

MS Flow check if lookup field is empty
MS Flow check if lookup field is empty
MS Flow check if lookup is empty
MS Flow check if lookup is empty

Read Power automate split string into an array with examples

Power Automate if person field is empty

Here we will see an example of Power Automate if the person field is empty.

So for this example, we will use the SharePoint list i.e. Project Management List.

Power automate if person field is empty
Power automate if person field is empty

In Power Automate, select the trigger ‘When an item is created. Then provide the site address and List name.

Power Automate check if person field is empty
Power Automate check if person field is empty

Next, initialize variable action, then provide the variable name, type as boolean, and in value as true.

Microsoft Flow check if person field is empty
Microsoft Flow check if person field is empty

Now we will check if the person field is empty or not, so click on the next step and select condition control. Then provide the

  • value: Assigned to Email
  • operator: is equal to
  • value: null

If the above condition is true, then set variable ‘isPersonFieldIsEmpty’ as true and if the condition is false then set variable ‘isPersonFieldIsEmpty’ as false.

Microsoft Flow check if person is empty
Microsoft Flow check if the person is empty

Now click on Save and to run the flow create an item in the Sharepoint list.

MS Flow check if person is empty
MS Flow check if person is empty
MS Flow check if person field is empty
MS Flow check if person field is empty

Related Power Automate tutorials:

In this Power Automate tutorial, we learned Power Automate if. And also we discuss the below Points:

  • Power automate if expression
  • Power automate if expression variable
  • Power automate if condition is blank
  • Power automate if get items is empty
  • Power automate if(equals)
  • Power automate if array is empty
  • Power automate if array contains
  • Power automate if another file is already there
  • Power automate if approved
  • Power automate if action fails
  • Power automate if attachment name contains
  • Power Automate if boolean
  • Power automate if body is empty
  • Power automate if expression boolean
  • Power automate if column equals
  • Power automate if cell is empty
  • Power automate if date is today
  • Power automate if date is less than today
  • Power automate if date is null
  • Power automate if day of week
  • Power automate if date is greater than today
  • Power automate if file exists
  • Power automate if field is blank
  • Power automate if file name contains
  • Power automate if folder exists
  • Power automate if field changed
  • Power automate if greater than
  • Power automate check if group exists
  • Power automate if integer
  • Power automate if list is empty
  • Power automate check if lookup is empty
  • Power automate if today is monday
  • Power automate if person field is empty
>