Hello,
I am having a little trouble trying to figure out how to take data from one sharepoint list and update another sharepoint list with it.
So i have two sharepoint list Employee Master Data and Employee Edit. What i am trying to do is when an employee submits a new item in "Employee Edit" it will update the data in "Employee Master Data" after a quick approval process. However i am having a hard time figuring out how to match the two lists togther.
From searching and reading alot of examples they mostly suggest using the List ID to match the two lists. However The employee recond at ID 20 on the "Employee Master Data" list is not the same as the record at ID 20 on the "Employee Edit" list.
I am aware that i need to find a value in both lists that will stay static as a way to link the two, of which the Email value is the best i can come up with.
Can anyone provide any suggestions or shed some light on a good way to go about this.
Solved! Go to Solution.
If you do a Get Items on the Employee master list you can supply an OData query that will get the record which matches the email address of the record in the Employee Edit list. The exact syntax taht you would use is dependent on how you are storing the email in SharePoint. Is it a single line of text field or a person field? If its a single line of text then the Odata query is justs
emailfield eq dynamiccontentfieldwithemail
If you do a Get Items on the Employee master list you can supply an OData query that will get the record which matches the email address of the record in the Employee Edit list. The exact syntax taht you would use is dependent on how you are storing the email in SharePoint. Is it a single line of text field or a person field? If its a single line of text then the Odata query is justs
emailfield eq dynamiccontentfieldwithemail
I did something like this recently.
You want to do a "Get Items" on the list you want to update, and in the filter query field put MASTER_DATA_COLUMN(not-dynamic content) eq 'employee edit column (dynamic content from the "when item is edited" trigger)'
Then, you will probably have to do an apply to each with the values being from the get items above. You'll then use that same ID to update your items with an action in flow, and use the dynamic content to populate the new list as you please. Not sure if your approval workflow will conflict with that.