So I basically have a flow that updates fields in a tasks. My issue now is the performance since I have to loop through every task, check if it's work order matches the one in my csv file, and then update that task's fields.
I have an action that returns all the tasks for a project.
I'm looking for another way to do this so I don't have to loop through every task, which is what I initially tried. Only issue was how it would take forever for the flow to finish running.
Every task has data and I can pull the correct custom field by doing: "items('Apply_to_each_Task_')?[variables('GetWorkOrderId')]" within the "Apply to each Task" action. I use that in the "Set variable" action here.
I've tried using a "Filter array" action but it doesn't work.
It just returns an empty array. Is this possible to do? Am I missing something in the filter array? Thank you.
A much better way of approaching this might be to use a Filter query - see my screen shot below. If you construct the query properly, you won't need to loop through all tasks - only tasks that meet your requirements will be returned. You condition can also be eliminated. Here is a link to a blog post that discusses how to construct the OData filter query.
The blog post discusses SharePoint but Project Online rubs on SharePoint so the same rules apply.
Thank you for the help. But it doesn't seem to work for me. I tried using the Id for the filter and it still returns nothing even though I'm using an Id that I know exists.
This is what is returned when I get all tasks with no filter.
But then when I try to do a filter using the Id and asking for the value that you see above, I get nothing.
Is there something wrong with my filter syntax?
This is a little bit of a kludge, I faced the same problem as you where the "list Tasks" flow with a filter returned empty.
For small projects this would be OK - i could see this being a problem with a larger project. Basically I used a for loop and checked each task that is returned for the task ID I wanted to manipulate.
Check out the on demand sessions that are available now!
ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.