Hi Community,
I have a SharePoint list "1" and SharePoint list "2".
SharePoint list "1" has a HeaderID column, and SharePoint list "2" has a HeaderID and a LineID column. Both lists have a Status column.
When I create an entry e.g. market in SharePoint list "1" , it will have a HeaderID of 1.
In SharePoint list "2", it holds details of entry in SharePoint list "1", so in this example, it will be talking about what I bought in the market. Let's say I bought an apple, in SharePoint list "2", the HeaderID would be 1 (HeaderID always follows the ID of the header record in SharePoint list "1), and LineID would be 1. Then I bought an orange which creates another line item in SharePoint list 2 and now, HeaderID of the orange item is 1 and LineID is 2.
How do I create a flow such that an update of an header item in SharePoint list "1" status will update the status column of ALL items having the same HeaderID to the same status in SharePoint list "2"?
Thank you.
HI @elleeyl
I think I can help you with this. First, we need a trigger that finds the items that are changed:
Then we need to check if the item was updated or created. We want only the updated ones so we compare the Created and Modified and if they are different then you know it's an update.
Next, we fetch only the values we want to update. That's where the "Filter Query" comes into play. Then it's just a question of updating the items from SharePoint list 2 with the values that you want.
Here's the Power Automation
Makes sense? If something is not clear please let me know and we'll try to figure this out.
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Cheers
Manuel
Hi @manuelstgomes ,
Thank you for your help. I am getting there but I have 1 more issue.
My HeaderID is not the same value as ID that gets generated by SharePoint. The status needs to be updated based on HeaderID value, so if I for example update HeaderID 33, two line items should be updated.
Perhaps the way I'm doing it is wrong, but when I specify HeaderID (i.e. 33) under ID, it will update ID 33 and not HeaderID 33.
When I specify ID as ID, it will update the wrong line item as well.
Kindly advise. Thanks.
Hi @elleeyl
You're almost there. 🙂
In the ID column, use the ID from SharePoint not the HeaderID. The HeaderID is only used to filter in the "Get Items".
Since the fields are mandatory, Power Automation requires that you fill them in when doing an "Update Item", but you can use the same values and keep the values that you want unchanged.
So just select the ID from when you do the "Get items" from the "Details 3" and update the status as you're doing now.
That will fix it :).
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Cheers
Manuel
Hi @manuelstgomes ,
Sorry, I need more help on this.
I have entered the following under Get Items and Update Item
Under Get Item, it is returning HeaderID as 52 (which is the SharePoint), which is wrong. It should be 34.
I have tried to use ID eq HeaderID under Get Items, and it returns ID as 34 which is correct. However it will then tried to update SharePoint ID 34, instead of HeaderID 34.
Thank you for your patience and guidance. Thank you.
May I know if anyone can help me with this please? Am stumped badly here. Thank you.
Hi @elleeyl
The formulas and strategies are correct. If you're getting the incorrect number is because you're probably fetching the ID from the wrong list.
Please check the following:
Could you please double check this?
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Cheers
Manuel
I'm sure is just a question of wrong fields being queried