cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nliu
Helper II
Helper II

How to update an existing item in SP List from another SP List ?

Hello,

 

I have two SP List with the same structure and I want to update both of my SP List when an item is modified in SP List 1 or in SP List 2.

But I don't have any column ID in this SP List, because my data is identified by 3 criteria : Structure, City and Date.

 

So, how can I do to specify that my "ID = Structure + City + Date" ?

 

Thank you for your help 🙂 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @nliu 

You should use the ID value of the "Get Items" action, and not the ID of the output of the trigger.

Could you check that?

Hope it helps.

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

13 REPLIES 13
fchopo
Super User
Super User

Hello @nliu 

You can use the SharePoint Get Items action using a Filter Query to update those items found depending on the condition:

2020-03-06 10_09_42-Create your flow _ Power Automate.png

 

1) When an item is updated in List 1

2) Find the items in the List 2 that have the same structure, city and date

3) Update the items that match the condition (it should be only one).

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hi @fchopo 

We have to check the list name and based on the listname we have to update the other list. So its better to use the condition action and check the listname, if yes update the list1 with the list2 details else update the list2 with the list1 details.

 

Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue

-Sudharsan K...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

@fchopo  thanks for helping,

 

I tried what you did but still doesn't work and I don't understand why...

 

 

FLow.jpg

Hello @nliu 

Please, remove the white spaces in the name of the columns when writing the filter expression, and use quote to surround values. Have a look at this example: PériodedeRéalisation eq '2020-03-05'

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

@fchopo 

 

 

Still doesn't work, 

Flow failed.jpg

 

But it creates a new row in my SP List 1 ... 

 

Test liste.jpg

@sudharsan1985  what do you mean by check the list name ?

Hi @nliu 

In your filters you had included the column name with '/' and I don't think so SharePoint will have an internal name with '/'. You told that updating one list should update the other. How would you know which list item is updated, so I asked you to check the list name and update the other list.

 

Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue

-Sudharsan K...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

@nliu It doesn't work because of the ' character in the expression (structuredel'enduitsuperficiel)

Can you try to rename your columns, not using special characters like ´ ` ' ?

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

@fchopo 

Hey I tried to rename my columns like this "Structure", "Ville" and "Date" but it says that the column "Structure" doesn't exist. That it might be deleted by an other user  :

 

{
"status": 400,
"message": "La colonne « Structure » n’existe pas. Elle a peut-être été supprimée par un autre utilisateur.\r\nclientRequestId: 53a3027b-e50e-48f7-842b-9bea0f9baa10\r\nserviceRequestId: 53a3027b-e50e-48f7-842b-9bea0f9baa10"
}
 
Listes.jpg

 

 
Thank you for helping me

 

 

Hi @nliu 

Try to use the internal name of the column in the filters. Though you renamed the column, only the display name will get changed and not the internal name. Navigate to the List settings page and click on the column, you can see the internal name on the end of the URL in the address bar.

 

Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue

-Sudharsan K...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

@sudharsan1985 Thank you it works ! But now the final step "Update the items" says Not found...

 

Not found.jpg

 

Hello @nliu 

You should use the ID value of the "Get Items" action, and not the ID of the output of the trigger.

Could you check that?

Hope it helps.

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

@fchopo @sudharsan1985 

 

FINALLY ! Thank you both for your help 🙂

 

YES.jpg

 

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.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,897)