cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mturner17
New Member

Add row to Lists or Excel table when Planner task created - even if some information is missing

Question: How do I add a row to either a SharePoint List or Excel table (I've tried both) when a Planner task is created.  One of the row columns will record the person assigned to the task (assignments Assigned To User Id).  The trick is that sometimes the task will have someone assigned to it and sometimes it will not.

 

Background: The issue is that when the trigger is executed (a Planner task is created) the task may or may not have someone assigned to it.  One of the columns in my List or Table will be the person assigned to the task.  The problem is that if "assignments Assigned To User Id" is blank the add row function will complete without populating any of the other information and therefore the row will not be created.  The result is that the flow says it has completed successfully but no row is added and the flow shows the actions within the "Apply to each" control as grayed out.

 

mturner17_2-1621362129310.png

 

 

mturner17_0-1621361787466.png

 

3 REPLIES 3

If there isn't someone assigned to the task your array will be empty and your for each will not contain any items (and no rows will be created). Also if more then one person is assignd to the task it will create more then one row with the same task (don't know if that is what you want or not).

 

Do you want one row per task or more then one row (if more then one person is assigned to it)?

I realize the "Assigned to User ID" array will be blank, but in this case I would like the row to still be created with the rest of the relevant information (task ID, Bucket ID, etc.).  If there is no one assigned to the task, I would like to simply leave that field blank for the created row.

 

Ideally, I would have just one row per task, even if multiple people are assigned, but I can deal with that separately once I have this issue resolved.

 

Any suggestions?

You could try to set a variable with all the users (if any) in it and set the assigned to in your excel to the value of the variable . 

 

CasperRoseboom_0-1621369330710.png

CasperRoseboom_1-1621369353022.png

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,227)