cancel
Showing results for
Did you mean:
Helper III

## calculated column flow error

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

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?

Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?

4 REPLIES 4
Super User

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?

Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?

Community Champion

@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.

Regards,
Anna Jhaveri

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

@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

Helper III

@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!

Announcements

#### Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

#### Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

#### Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,095)