cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
drweby2
Frequent Visitor

add new planner card to excel sheet if id of card not exist in the sheet

i create a sheet with planner tasks and i wanna to add a new row in this sheet if a new card (not exist in excel sheet )is created

 

here is my flow but it not working it add 5 rows for each card in the plan

sss.png

1 ACCEPTED SOLUTION

Accepted Solutions
jwhite Resolver III
Resolver III

Re: add new planner card to excel sheet if id of card not exist in the sheet

Hi @drweby2,

My suggestion would be that you use a filter equating the ID of the task and the ID in the table on your list rows and then check to see if that list has any items. If it does, do nothing and if it doesn't add the item:

 

Similar your flow I first get a list of tasks, but then in the apply to each for this list I filter the List rows with the ID Column in excel being equal to the ID of the task:

 

ListPlannerFilter.png

I then have a condition to check to see if that filtered list has any items in it. If it does, that means that the task ID already exists so I do nothing. If it is empty it doesn't exist, so I create the row with the task.

ListPlannerCondition.png

The condition that I am checking is the length of the array created by the list rows present in a table with the expression:

length(body('List_rows_present_in_a_table')?['value'])

ListPlannerExpression.png

Let me know if that helps!

 

Full flow in spoiler:

Spoiler
ListPlannerFullFlow.png

View solution in original post

3 REPLIES 3
jwhite Resolver III
Resolver III

Re: add new planner card to excel sheet if id of card not exist in the sheet

Hi @drweby2,

My suggestion would be that you use a filter equating the ID of the task and the ID in the table on your list rows and then check to see if that list has any items. If it does, do nothing and if it doesn't add the item:

 

Similar your flow I first get a list of tasks, but then in the apply to each for this list I filter the List rows with the ID Column in excel being equal to the ID of the task:

 

ListPlannerFilter.png

I then have a condition to check to see if that filtered list has any items in it. If it does, that means that the task ID already exists so I do nothing. If it is empty it doesn't exist, so I create the row with the task.

ListPlannerCondition.png

The condition that I am checking is the length of the array created by the list rows present in a table with the expression:

length(body('List_rows_present_in_a_table')?['value'])

ListPlannerExpression.png

Let me know if that helps!

 

Full flow in spoiler:

Spoiler
ListPlannerFullFlow.png

View solution in original post

drweby2
Frequent Visitor

Re: add new planner card to excel sheet if id of card not exist in the sheet

Thx alot it work just fine 

i wanna also to add if task id exist but the task title ,due date , start date and assigned to user are not the same add a row in the table 

Highlighted
jwhite Resolver III
Resolver III

Re: add new planner card to excel sheet if id of card not exist in the sheet

Hi @drweby2,

In this case you can add another condition in the "If task already exists" branch of our first condition (the false branch, when our filtered list isn't empty).

This condition just checks if each property is the same. As we are using an AND property on the condition, if they are all the same then it will do nothing. If any of them don't match it we then just use the add row to excel table as before:

PlannerListDifferentDetails.png

You can add any fields which have to match as an additional row to the condition.

Let me know if this helps!

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,794)