I have a Flow that creates a item in a Sharepoint List when a Task is created in Planner.
I then have a second Flow that is triggered whenever a Task is completed in Planner. ThatFlow gets items from the Sharepoint list and filters them by Planner Task ID and updates the Sharepoint List Item that relates to the task that has been created in Planner.
There are some circumstances where that second flow doesn't identify the original entry in the Sharepoint list.
Where this happens I would like the Flow to create a new item in the Sharepoitn list to state all the details of the Task that has been completed in Planner.
I cannot figure out how to write that part of the Flow that recognises when the Planner Task ID has not been found, so I can tell it to then create a new Sharepoint list item.
Can anyone help with how I can do this?
Solved! Go to Solution.
Hi @Walker,
Could you please share a bit more about your SharePoint list?
Could you please share a screenshot of your two flows' configuration?
I have created a SharePoint list on my side and the data structure of it as below:
Note: Planner Task ID column is a Single line of text type column, Task Title column is a Single line of text type column, Start Date Time column and Due Date Time column are both Date type column, IsCompleted column is a Yes/No type column. The IsCompleted column indicates if the task is completed in Planner and the default value of it is No.
The flow works successfully as below:
@empty(body('Filter_array'))
items('Apply_to_each')?['ID']
Title field set to following formula:
items('Apply_to_each')?['Title']
IsCompleted field set to Yes.
Image reference:
The flow works successfully as below:
Best regards,
Kris
Hi @Walker,
Could you please share a bit more about your SharePoint list?
Could you please share a screenshot of your two flows' configuration?
I have created a SharePoint list on my side and the data structure of it as below:
Note: Planner Task ID column is a Single line of text type column, Task Title column is a Single line of text type column, Start Date Time column and Due Date Time column are both Date type column, IsCompleted column is a Yes/No type column. The IsCompleted column indicates if the task is completed in Planner and the default value of it is No.
The flow works successfully as below:
@empty(body('Filter_array'))
items('Apply_to_each')?['ID']
Title field set to following formula:
items('Apply_to_each')?['Title']
IsCompleted field set to Yes.
Image reference:
The flow works successfully as below:
Best regards,
Kris
Kris - thanks a lot for taking the time to respond - I'm working through implementing this now and will report back once complete.
In the meantime, can you explain more about the Filter array action, becuase to me it look slike this is doing the fundamental part I needed help with - determining if there is no positive return, and taking further action if that is the case.
Hi @Walker
This is straight from the Microsoft Flow documentation:
"Use Data Operations - Filter array to reduce the number of objects in an array to a subset that matches the criteria you provide."
Here's the example provided in the documentation:
You have the following array -
[{"first": "Deon","last": "Herb"},{"first": "K","last": "Herb"}]
After you add the "Data Operations - Filter array" action to your Flow, configure it like the screenshot below.
Once your Flow runs, the filter array output should look like this:
[{"first": "Deon","last": "Herb"}]
Please let us know if you have any questions.
Regards,
Fausto Capellan, Jr
Thanks Fausto.
My original flow used a condition where I asked - does the ID of the Completed Task match the ID of a Task listed in the Sharepoint list - this meant I had 1 where it did, and all the other items counted as "No".
I couldn't work out how to then generate a single new entry where there were multiple "No"s.
I see now that the array/condition combination instead reduces the number of outcomes to either a single "Yes" or "No" if nothing is found (using the filter), and then checks the output array for whether there is an instance or there is nothing.
Very neat.
Many thanks for all the help both of you.
Hi
In February 2018, you posted advice to this post
I’m interested in duplicating this advice but when I get to point number 4 it seems that I have more options in the condition, see below
Can you suggest how to fill this in?
I’m super new to Power Automate and have zero coding knowledge.
Thanks
User | Count |
---|---|
27 | |
16 | |
16 | |
12 | |
11 |
User | Count |
---|---|
42 | |
30 | |
28 | |
25 | |
24 |