cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RossBroadley
Helper III
Helper III

Flow to send an email based on sharepoint column vs now. (Takes a long time to run)

Hi there, 

I'm new to flow and have been tasked with creating a flow which emails users when the sharepoint column 'Expiry' is due to expire in the next 4 months. The flow should email each user once. 

To achieve this I have created a conditional flow. But I'm having some issues filtering the sharepoint data and running the flow. 

The conditions required are for the Expiry date to be in the next 120 days, and for the TEST LICENSE STATUS to be set as 'Notification Not Sent' 

After the flow retrieves the relevant sharepoint records and emails the user. The flow should update the sharepoint record to 'Notification 1 Sent'. Which will prevent the user from receiving further emails. 

I will then be creating another flow for escalation purposes which follows the same structure, with different staff being contacted when within one month of expiry for example. 

Here are some images of the flow: 
NOTE Recurrence is set at 1 year so the flow won't run automatically during testing
 

RossBroadley_0-1593020035465.png

 

 

 

RossBroadley_2-1593020184590.png

 

 

RossBroadley_3-1593020237032.png

 

Any help would be greatly appreciated! 

 

Ross

 




1 ACCEPTED SOLUTION

Accepted Solutions
edgonzales
Super User II
Super User II

@RossBroadley 

Hi there.   There are a couple of ways to approach this, but I think one reason it's taking so long is that it is grabbing ALL of the rows, and then looking at each one to see if it meets the condition (one at a time).

 

You might consider either an OData filter on the Get Items step (Click on "Show advanced options" and then use the "Filter Query" bit), or add a "Filter Array" action after. 

 

Give either of those a go and see if that changes anything.

Keep us posted.

-Ed

 

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

4 REPLIES 4
edgonzales
Super User II
Super User II

@RossBroadley 

Hi there.   There are a couple of ways to approach this, but I think one reason it's taking so long is that it is grabbing ALL of the rows, and then looking at each one to see if it meets the condition (one at a time).

 

You might consider either an OData filter on the Get Items step (Click on "Show advanced options" and then use the "Filter Query" bit), or add a "Filter Array" action after. 

 

Give either of those a go and see if that changes anything.

Keep us posted.

-Ed

 

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

Hi @edgonzales 
Thanks for getting back to me! 

Originally I tried using an oData filter query. However, I was unable to get the 'And' operator working. 

Might have to look at how the filter array works. But I was looking to keep this as simple as possible as I will be handing this over to a different department once development is complete. 

See below for images. 

RossBroadley_0-1593024781751.png

RossBroadley_1-1593024833550.png

 

 

RossBroadley
Helper III
Helper III

@edgonzales  You the man haha! 

I used to the filter array and it worked first try! 

Here's how it looks.

RossBroadley_0-1593025746356.png

 

Thanks a million,
Ross

 

@RossBroadley 

Great work!  And +1 for the use of Scope!

 

On the OData, I've seen a few threads on how spaces in SharePoint column headers cause trouble.  I wouldn't be surprised if that's the thing giving you grief.  Here's a thread on the topic:  OData syntax for sharepoint column with a space - Get Items action.

 

Keep at it!  You're making great progress.

-Ed

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,896)