Hi,
I want to create a flow that if a sharepoint item is not modified for 2-3 days, an email will be sent to the user.
I have a SharePoint list where we have columns as state, Owner, waiting for, modified date etc. My issue is first condition (to check for state value) is not working/not getting any state value ( closed, open, waiting for approval, rejected etc) and in the second condition where i used the expression that if "modified date < addDays(utcNow(), -2)"
is not working.
Can someone please help me out
Solved! Go to Solution.
Hi @Anonymous,
When comparing two date, please make sure they have the same format.
Dynamic content Modified will return a date time likes below:
2018-09-26T06:42:18Z
While function adddays(utcnow(),-2) will return a date time with following format:
2018-09-24T07:01:29.4716815Z
So the condition won’t work in your flow.
Please input the following code in the Condition in Advanced mode:
@equals(formatDateTime(items('Apply_to_each')?['Modified'], 'yyyy-MM-dd'),formatDateTime(adddays(utcnow(),-2),'yyyy-MM-dd'))
Hope it could be your reference.
Best regards,
Mabel Mao
@Anonymous:
I suspect that your status column is a choice column. If so, the condition comparison is case sensitive - check to make sure the case and spelling in the conditions matches the column.
Also, you are better off using a filter in get items rather than using a condition. By default, Get Items returns only 100 items. Here is a link to a blog I wrote that explains how to change the default. The max is 500 items for most Flow plans.
If you want to use a filter, here is how it should look:
Scott
@Anonymous:
Can you post a screen shot of your Flow - that will make it much easier to assist.
Scott
Hi @ScottShearer,
Thank you for the response. Here are some screenshots of the flow i tried to create.
Below are the state values that we added in the Sharepoint items
Hi @Anonymous,
When comparing two date, please make sure they have the same format.
Dynamic content Modified will return a date time likes below:
2018-09-26T06:42:18Z
While function adddays(utcnow(),-2) will return a date time with following format:
2018-09-24T07:01:29.4716815Z
So the condition won’t work in your flow.
Please input the following code in the Condition in Advanced mode:
@equals(formatDateTime(items('Apply_to_each')?['Modified'], 'yyyy-MM-dd'),formatDateTime(adddays(utcnow(),-2),'yyyy-MM-dd'))
Hope it could be your reference.
Best regards,
Mabel Mao
Hi @v-yamao-msft ,
Thanks for the reply. I will try to use the logic what you told and will let you know if it works.
Meantime, on the first condition, its not getting the status values... The first condition picks all the Items apart from status value ( closed, open, verified etc). How can i add the condition to only pick the items that are not closed?
Thanks!
Azeem
@Anonymous:
I suspect that your status column is a choice column. If so, the condition comparison is case sensitive - check to make sure the case and spelling in the conditions matches the column.
Also, you are better off using a filter in get items rather than using a condition. By default, Get Items returns only 100 items. Here is a link to a blog I wrote that explains how to change the default. The max is 500 items for most Flow plans.
If you want to use a filter, here is how it should look:
Scott
Hi @ScottShearer,
Thank for the reply. Changing the pagination value is awesome and i already had it configured on my get item action.
Secondly, the reason i choose a condition to get the state value is only because i want all the items except that are closed. Below is the choices i have i state value.
i tried the condition as case sensitive but it didn't worked as well... May be i can try something different to get all the items except the one closed.
@v-yamao-msft the modified advance function is working. Thanks for the help champ!
if i get the state value in my first condition working, it will be sweet as heaven.
/Azeem
Hi @Anonymous,
Thanks for updating and I am glad to hear that it works for you.
About your first condition, from the screenshot, it seems that you have many choices for the State column, and the choice value Closed is configured as “6. Closed”. So in your first condition, please try to change it as State Value is not equal to 6. Closed.
Please take a try with it.
Best regards,
Mabel Mao
@Anonymous:
The filter expression I showed above will limit the items returned to those not closed - I used ne which equates to not equal.
Thanks @ScottShearer it really worked.
i also tried to add below query in Advance condition but no luck. Could you tell me what i am missing in there?
@or(not(equals(items('Apply_to_each')?['State']?['Value'], 'X. Closed')),not(equals(items('Apply_to_each')?['State']?['Value'], 'X. Rejected')),not(equals(items('Apply_to_each')?['State']?['Value'], 'X. Superseeded')))
i thought of adding 'OR'statement and filter result further.
/Azeem
Hi @ScottShearer and @v-yamao-msft,
Both of your solution worked and now my Flow is working as charm... Thanks alot guys... Million Kudos 😉
/Azeem
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
91 | |
58 | |
42 | |
39 | |
37 |
User | Count |
---|---|
84 | |
72 | |
56 | |
56 | |
43 |