Hi everyone,
I am trying to build a flow that will check my Outlook calendar for the current day and create a task in To-Do for every meeting I have today that has no Category because I don't want to see the events I've categorized in my calendar such as Focus Time (Green Category) or Lunch (Purple Category) etc. in my To-Do's.
I've already tried typing below expressions for the Filter Query field but none of them worked:
Could you please check my flow below and give feedback on how to use the Filter Query functionality?
P.S. My flow works just fine without applying Filter Query. It runs every midnight and creates To-Do's in my designated list for the current day's events but I would like to only see the events with no category, like this event:
Thanks!
Solved! Go to Solution.
Hi @Expiscornovus,
I tried filtering by Green Category (C is upper case 🙂) like your solution, and it worked.
I think I also found a workaround. Since I only have max 10 items in my calendar in a regular day, I did not apply Filter Query to Get calendar view of events but added a condition to create a To-Do only if Categories does not contain either of the categories.
Hi @melikeaskin,
The solution should work, nicely found. Only challenge will probably be that you need to update the flow whenever you introduce a new category in your Calendar.
Another approach could be to use a filter array and check if the categories field is empty.
empty(item()?['categories'])
is equal to true
Hi @melikeaskin,
Categories is an array, which makes a bit more challenging in an OData filter query 😁
I just tested and this format seems to work for checking if the Green category is assigned. Keep in mind that it is case sensitive. I am still looking at the check for empty
categories/any(c:c+eq+'Green category')
Hi @Expiscornovus,
I tried filtering by Green Category (C is upper case 🙂) like your solution, and it worked.
I think I also found a workaround. Since I only have max 10 items in my calendar in a regular day, I did not apply Filter Query to Get calendar view of events but added a condition to create a To-Do only if Categories does not contain either of the categories.
This flow actually works. I only get events with no category with this flow right now.
@Expiscornovus, My question is, do you think this solution makes sense? Would it cause any problems in the future?
Thanks a lot!!
Hi @melikeaskin,
The solution should work, nicely found. Only challenge will probably be that you need to update the flow whenever you introduce a new category in your Calendar.
Another approach could be to use a filter array and check if the categories field is empty.
empty(item()?['categories'])
is equal to true
Hi @Expiscornovus,
When I used a filter array and check if the categories field is empty I still got all events including events with a category.
Is this what you mean? Thanks!
Hi @melikeaskin,
The filter array setup looks ok.
Just to double check, what is the rest of your setup. Are you using the outputs of your filter array action in your apply to each loop?
I am looking to do the same but cannot get this solution to work. When I copy and paste
categories/any(c:c+eq+'Green category')
into my filter query box and I change it to my category name, I still get an invalid query syntax error. Am I missing something?
Hi @MLachanceDFG, the expression is case sensitive. Please don't forget to write "Green Category" instead of "Green category".
Dear @Expiscornovus, I fixed my flow by using the outputs of the filter array action in next steps i.e. apply to each loop. Flow works, but for some reason for all meetings with no category are created as To-Do's but one meeting gets created as To-Do twice every time.
I continued with the condition scenario and it works for now 🙂 I will edit the condition in the future if I add a category.
Thanks!
Unfortunately, it doesn't seem to matter what I type in for my category name, the syntax of the function itself is not being accepted as you've written it. Are you doing something advanced with it that you haven't detailed? I'm not understanding why the expression isn't valid if it's working for both of you.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
71 | |
27 | |
22 | |
15 | |
13 |
User | Count |
---|---|
136 | |
43 | |
42 | |
35 | |
31 |