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.
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.
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
Hi @critski
You should use the space in the column name as and the expression as:
Toilets_x0020_required eq 1
Hope this Helps!
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?
Hi @critski
Please see the screenshot below:
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!
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
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional