Hi, I built a couple of app already, but im pretty much new to flow. I created a calculated column test2 in SharePoint to count the days between two dates, which works perfect and looks like that:
=IF(ApprovedDate<>"",0,IF(SendForApprove="",0,IF(ISERROR(DATEDIF(SendForApprove,TODAY()-1,"d")),"",(DATEDIF(SendForApprove,TODAY()-1,"d"))+1-INT(DATEDIF(SendForApprove,TODAY()-1,"d")/7)*2-IF((WEEKDAY(TODAY()-1)-WEEKDAY(SendForApprove))<0,2,0)-IF(OR(AND(WEEKDAY(TODAY()-1)=7,WEEKDAY(SendForApprove)=7),AND(WEEKDAY(TODAY()-1)=1,WEEKDAY(SendForApprove)=1)),1,0)-IF(AND(WEEKDAY(SendForApprove)=1,(WEEKDAY(TODAY()-1)-WEEKDAY(SendForApprove))>0),1,0)-IF(AND(NOT(WEEKDAY(SendForApprove)=7),WEEKDAY(TODAY()-1)=7),1,0))))
I set it up as Number.
Then, I tried to create a flow to send an email, if the number is for example bigger than 2. I have tried to use initialize variable and compose, but it didnt work. I have tried to follow some of the guidance from other posts, but it didint work for me. I would appreciate, if someone could have a look at point out, where I went wrong?
Solved! Go to Solution.
Hi @batmanMon,
Just to validate. Do you have an apply to each loop?
I think you are pretty close to the solution. Try and use the test2 dynamics value from the get items action and use an int function to convert it into an integer.
Add it within an apply to each loop like in the screenshot below. That apply to each loop can use the value output of your get items.
Hope this helps a bit?
Hi @batmanMon,
Just to validate. Do you have an apply to each loop?
I think you are pretty close to the solution. Try and use the test2 dynamics value from the get items action and use an int function to convert it into an integer.
Add it within an apply to each loop like in the screenshot below. That apply to each loop can use the value output of your get items.
Hope this helps a bit?
@batmanMon , are you using a calculated column in filter query of Get Items action, then I think that is not possible, calculated columns are not support in filter query.
@annajhaveri, Thank you! I realized that calculated columns are not supported in filter query, hence I asked for help, as ive tried three different ways to make my flow to work, but couldn't figure out how. I attached 3 pictures in my question. I would appreciate, if you could help me with finding the solution.
@Expiscornovus , I have tried to add apply to each loop as per your screenshot, but i'm getting an error message as per picture. I would really appreciate, if you could have a look and tell me, where am I going wrong
@Expiscornovus I just realized what ive done wrong. I was working on Apply to each 3, so just corrected the formula to 'Apply_to_each_3' and it did work. I will delete the other rubbish trials, which didn't work. Thank you very much! You are a life saver!
User | Count |
---|---|
92 | |
44 | |
21 | |
17 | |
16 |
User | Count |
---|---|
136 | |
49 | |
42 | |
36 | |
28 |