cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chase_Ho
Level: Powered On

How to update an item in a SharePoint list base on the changes from another SharePoint List?

HR department is having a list to reocrd the information of every employees (now we call this list as "Employee Profile").

 

On the other hand, HR also requires team leaders to upload the resigination letters to another list as well (we call this list as "Resignation Log").

 

Once HR see that there is a new resignation letter received, she would find out the Employee ID from "Resignation Log", then change the status at "Employee Profile" base on the Employee ID she found.

 

And I would like to know that could we create a flow to modify an item in a list once an item created in another list?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: How to update an item in a SharePoint list base on the changes from another SharePoint List?

Hi @Chase_Ho,

 

Could you please show more details about the Employee Profile list and the Resignation Log list on your side?

 

I have created a Employee Profile list on my side and the data structure of it as below:23.JPG

Note:  The Employee ID and Employee Name are both Single line of text type column. The Department column is a Choice type column. The Status column is a Choice type column and the available values of it is In-service and Departure

 

I have also created a Resignation Log list on my side and the data structure of it as below:24.JPG

Note: The Employee ID column is a Single line of text type column, the Resignation Date is a Date type column.

 

I have made a test on my side and please take a try with the following workaround:

  • Add a "When an item is created" trigger, specify Site Address and List Name set to Resignation Log list.
  • Add a "Get items" action, specify Site Address and List Name set to Employee Profile list.
  • Add a "Filter array" action, From set to output of "Get items" action. Click "Edit in advanced mode", type the following formula:
@equals(item()?['Employee_x0020_ID'], triggerBody()?['Employee_x0020_ID'])
  • Add a "Apply to each" action, input parameter set to output of "Filter array" action.
  • Within "Apply to each" action, add a "Update item" action, specify Site Address and List Name set to Employee Profile list. Id field set to following formula:
item()?['ID']

Title field set to following formula:

item()?['Title']

Status Value field changed to Departure.

 

Image reference:25.JPG

 

26.JPG

The flow works successfully as below:27.JPG

 

The Changes within Employee Profile list and Resignation Log list as below:29.JPG

 

28.JPG

 

 

 

Best regards,

Kris

 

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
7 REPLIES 7
Highlighted
Community Support Team
Community Support Team

Re: How to update an item in a SharePoint list base on the changes from another SharePoint List?

Hi @Chase_Ho,

 

Could you please show more details about the Employee Profile list and the Resignation Log list on your side?

 

I have created a Employee Profile list on my side and the data structure of it as below:23.JPG

Note:  The Employee ID and Employee Name are both Single line of text type column. The Department column is a Choice type column. The Status column is a Choice type column and the available values of it is In-service and Departure

 

I have also created a Resignation Log list on my side and the data structure of it as below:24.JPG

Note: The Employee ID column is a Single line of text type column, the Resignation Date is a Date type column.

 

I have made a test on my side and please take a try with the following workaround:

  • Add a "When an item is created" trigger, specify Site Address and List Name set to Resignation Log list.
  • Add a "Get items" action, specify Site Address and List Name set to Employee Profile list.
  • Add a "Filter array" action, From set to output of "Get items" action. Click "Edit in advanced mode", type the following formula:
@equals(item()?['Employee_x0020_ID'], triggerBody()?['Employee_x0020_ID'])
  • Add a "Apply to each" action, input parameter set to output of "Filter array" action.
  • Within "Apply to each" action, add a "Update item" action, specify Site Address and List Name set to Employee Profile list. Id field set to following formula:
item()?['ID']

Title field set to following formula:

item()?['Title']

Status Value field changed to Departure.

 

Image reference:25.JPG

 

26.JPG

The flow works successfully as below:27.JPG

 

The Changes within Employee Profile list and Resignation Log list as below:29.JPG

 

28.JPG

 

 

 

Best regards,

Kris

 

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Chase_Ho
Level: Powered On

Re: How to update an item in a SharePoint list base on the changes from another SharePoint List?

Kris, Thank you very much for your suggestion below. I am sorry that i am out of office now which I could not have a test on it, but I think it is workable and inspire me a lot. On the other hand, may I know that how could I learn the syntax rules to write formulas in creating flows (or other Office 365 functions) like you did below? I am just good at using excel and VBA, not sure if I am qualified to do so, it would be better if there is some instruction for me to learn. Thank you again. Best regards, Chase
Community Support Team
Community Support Team

Re: How to update an item in a SharePoint list base on the changes from another SharePoint List?

Hi @Chase_Ho,

 

Microsoft Flow has its own expression rule, if you want to use expression within flow actions, please check the following article:

Using expression in flow actions

 

More details about the WDL expression, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jav-226
Level: Power Up

Re: How to update an item in a SharePoint list base on the changes from another SharePoint List?

Hi Kris,

 

I wanted to develop similar function using SharePoint list. 

 

Do you mind if I ask what is the x0020 in the Employee ID meant for?

Employee_x0020_ID

 

JKat
Level: Powered On

Re: How to update an item in a SharePoint list base on the changes from another SharePoint List?

x0020 is a space. e.g. the Sharepoint field name would have been "Employee ID", so it becomes 

Employee_x0020_ID

If you look at the Sharepoint list via Site Libraries and lists (i.e. open the settings page for tha list), the click on the field as it to edit it, you can see the correct format of the name at the end of the page address.

JessBerry
Level: Power Up

Re: How to update an item in a SharePoint list base on the changes from another SharePoint List?

Hello, 

 

I have found this information quite helpful however I am havingone issue. The connecttion seems to be set up and working however it is changing the status of all entries in my second list. 

 

I am creating an acceptance form for students in a program. When a student accepts their seat it should look them up by their Student ID and change their status in my student contact list from perspective to current. However when I test this, it is changing ALL my students on my list to current. 

 

Any thought on what I might be doing wrong or where to look? 

Abi2
Level: Power Up

Re: How to update an item in a SharePoint list base on the changes from another SharePoint List?

HI, 

 

i am trying to recreate an exact table of yours with very similar situations and objectives, the only difference is my employee ID is not a 4 digit number but instead a code (AA123,AB165) and hence the filter array is unable to locate my employee ID. and suggestions of how to solve this so i can lookup the unique employee ID from the parent list

 

Thanks!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 209 members 3,993 guests
Please welcome our newest community members: