cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nicholas_N
Level: Powered On

How to configure a Flow with multiple, similar conditions?

Scenario:

  • We have a SharePoint list where an item can have up to 4 different deadline dates in 4 separate columns
  • I need to set up a daily flow that sends an email alert whenever one of those dates is within a certain time range - 6 months for example
  • I know how to find a matching date using an expression like eq 'formatDateTime(addDays(utcNow(),+180),'MM-dd-yyyy')', and the Condition/Control action seems like the obvious path

Question: What would be a good way to configure conditions that will pull out the matching date and disregard others, so I can then send it in an email alert?

7 REPLIES 7
Highlighted
Super User
Super User

Re: How to configure a Flow with multiple, similar conditions?

Hey @Nicholas_N 

I'd do this as follows:

  1. Create a view on SharePoint list which displays those items which an alert should be generated for.
  2. Create your Flow,
    1. Trigger from a schedule
    2. Use the SharePoint 'Get Items' action to retrieve all items in the view and then send the required alert

a.png

 

Optionally - you can also add a column to the list allowing you to record the last time an alert was sent and then use this in your view logic to determine when to show items in the view

HTH

Jay

-------------------------------------------------------------------------

If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up.

Nicholas_N
Level: Powered On

Re: How to configure a Flow with multiple, similar conditions?

Thank you @Jay-Encodian for the reminder on using Views.

That's helpful to narrow down the input, but the extra challenge is that those dates could be subject to change, and I'd prefer not introducing more columns that add to the complexity.

 

Looking at what can be done with the Condition part, I'm not finding clear documentation on the behavior, so at I'm the stage of testing the difference between the following scenarios. I'm guessing that I need to introduce a variable in order to capture the matching date's column and relay it to the email being sent out.

 

I'm still early on this Flow journey so I'll appreciate any feedback.

 

Capture1.PNGCapture2.PNG

Super User
Super User

Re: How to configure a Flow with multiple, similar conditions?

Hi @Nicholas_N 

I was expecting that the data would change... personally I think you should still to do this by filtering the data in SharePoint and then bringing the data into Flow. The suggestion for an additional column was to record when you had sent an alert for a particular item, whether you filter in the SharePoint view or using Flow conditions... that would apply to both if you chose to records alert activity in this way.

It's akin to building a client / server application... you should query for the smallest data set possible and then process that data as opposed to bringing a large data set back and filtering on the client.

HTH

Jay

Nicholas_N
Level: Powered On

Re: How to configure a Flow with multiple, similar conditions?

Yes I'm definitely trying to keep in mind the 'smallest data set' best practice. 

In our context there's no need to keep track of sent alerts at this level, as the outgoing email from Flow will go out to a ticketing system.

 

My main challenge is figuring out a reliable way to check daily for a date that's 'X number of days from today' from this SharePoint list of items that can have up to 4 dates that will change over time.

Example:

Capture.PNG

Super User
Super User

Re: How to configure a Flow with multiple, similar conditions?

Hey @Nicholas_N 

Can you provide some context to these deadlines... it doesn't make a whole of sense... the deadlines must mean something, noting that some deadlines are blank.

Understanding what the date is, how it will be updated, what views needs to be constructed will enable us (the community) to help.

Cheers J

Nicholas_N
Level: Powered On

Re: How to configure a Flow with multiple, similar conditions?

Yes, let me try to explain this scenario better. 

 

* Each item is something like a lease

* Each lease can have from 1 to 4 renewal options (hence some blank fields) that are manually updated over time when an option is exercised, replaced or just expires. 

 

From this I'm looking to set up a daily flow that will: 

1. Check those 4 columns for a date that falls withing a certain range - 6 months / 180 days for example -

2. So it can send an email template that says something like "Lease X has a renewal option that will reach its deadline 6 months from today"

 

At this stage, I don't necessarily need to differentiate which column the matching date is in, as the email includes other details with a link to the item in the SharePoint list. 

Capture10.PNG

I hope this is a better explanation. 

Handling these 4 columns is what's confusing me, as I have other working Flows that pull from 1 date column using: 

Capture11.PNG

Nicholas_N
Level: Powered On

Re: How to configure a Flow with multiple, similar conditions?

(unintended double post)

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,357)