Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

send a message to teams when a sharepoint YES/no Column is ticked and a date is approaching

(0) ShareShare
ReportReport
Posted on by 34

I'm trying to create a flow that retrieves a sharepoint event list checks whether a custom yes/no column is ticked and also checks if the start date of the event is less than 2 weeks away.  If the column is ticked and less then 2 weeks away to the event it sends a message to a teams group.

The bit I'm having trouble with is how to query the custom column and the event start date.

  • yashag2255 Profile Picture
    24,442 Super User 2024 Season 1 on at
    Re: send a message to teams when a sharepoint YES/no Column is ticked and a date is approaching

    Hi @critski 

     

    Glad that it worked. Please note that teh ODATA filters have some limitations over the connectors for different datatypes (different for SP, excel, CDS etc.) You might want to look at some examples/blogs before implementing the flow. If you face any issues with these, please feel free to reach out here. 

  • critski Profile Picture
    34 on at
    Re: send a message to teams when a sharepoint YES/no Column is ticked and a date is approaching

    Yep!  Got it working thanks for your help @yashag2255 I had a couple of issues with date formats but other than that its working as expected

  • yashag2255 Profile Picture
    24,442 Super User 2024 Season 1 on at
    Re: send a message to teams when a sharepoint YES/no Column is ticked and a date is approaching

    Hi @critski 

     

    You should use the space in the column name as and the expression as:

    Toilets_x0020_required eq 1

     

    Hope this Helps!

  • critski Profile Picture
    34 on at
    Re: send a message to teams when a sharepoint YES/no Column is ticked and a date is approaching

    Just wanted to check if I need to bracket column names if they have spaces in them.  EG. [ Cust Col] eq 1

     

    Ive changed the filter query to   

     equals(parameters('Toilets required'), '1')

    I'm not sure if thats the correct format or not?

  • Verified answer
    yashag2255 Profile Picture
    24,442 Super User 2024 Season 1 on at
    Re: send a message to teams when a sharepoint YES/no Column is ticked and a date is approaching

    Hi @critski 

     

    Please see the screenshot below:casl.PNG

    By events list, I am assuming that you have created a calendar app and the list is the name of that. So in the Get Items, that list will not show up in the drop down. You have to add a custom value and enter the name of the list over here. 

     

    The Yes/No columns of SP are of type boolean and so I am filtering only those items that have the value as Yes in the Get items action only.  (CustCol is my Yes/No column on the Event list). 

     

    Now in the apply to each i am iterating on all the events recieved from the get items action and then checking if the start time is before two weeks from now. 

     

    The exprfessions used are:

    Left : ticks(formatDateTime(items('Apply_to_each')?['EventDate'],'dd-MM-yyyy'))
    Operator: Lesser than
    Right: ticks(formatDateTime(addDays(utcNow(),14),'dd-MM-yyyy'))

    You might want to convert the timezone for acurate values. 

     

    Edit: Please change the filter query to CustCol eq 1.

     

    In SP Yes/No column, the values are No- 0, Yes- 1.

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Willemijn Profile Picture
    214 on at
    Re: send a message to teams when a sharepoint YES/no Column is ticked and a date is approaching

    You could do that by using the action 'Send an HTTP request to SharePoint' maybe? 

    you'r Uri should look like: _api/web/lists/EventsList/items?ge datetime'" + today.toISOString() + "'

     

    in that way you only get the future events, and from there you could check if the date is less then today + two weeks and if your other value is yes/no

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow