Forum Discussion

smaharms-wende's avatar
smaharms-wende
Copper Contributor
May 11, 2023

automate update of a sharepoint list column item based on lookup / in another sharepoint list

High everyone,

Subject: update a sharepoint list column item automatically with  a lookup / filtered value of another sharepoint list.

We use in a sharepoint site 2 lists (master | riskcat) to do riskmanagement. 

Within the master list, the process owner rates the process risk with 2 values, impact and probability.
The field risk is a calculated column (impact x probability).
master

processrisk (char)impact (int1)probability (int1)

rIsk (int)

riskclass (char)

The column riskclass is the brinbback colum of a additional second list called riskcat.

 

riskcat     (risk-categories)

risk (int)riskclass (char)

The column risk  (INT) contains the risk values (1- 100 ) and the column riskclass contains the assigned class information. With the help of an additional lookup field risk1 (master list) the user will be able to get the riskclass information manually.
We are searching for a automate solution.

Trigger: If field value master.risk changes (create or update)
Request:  lookup/filter the list riskcat with the condition master.risk==riscat.risk => bringback riscat.riskclass and update column item master.riskclass.

I hope power automate can help, but the GetItem (ID) is the wrong way.
Any help is appreciated.

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    smaharms-wende 

    To automate the update of a SharePoint list column item based on a lookup or filtered value from another SharePoint list, you can use Power Automate (previously known as Microsoft Flow). Here's how you can achieve this:

    1. Open Power Automate and create a new flow.
    2. Choose a trigger that suits your needs. For example, you can use the "When an item is created or modified" trigger to monitor changes in the master list.
    3. Add a "Get items" action to retrieve the corresponding item from the riskcat list. Configure the action with the following settings:
      • Site Address: Select the SharePoint site where the riskcat list is located.
      • List Name: Select the riskcat list.
      • Filter Query: Enter the filter query to match the risk value from the master list. For example, risk eq '[master][risk]'.
    4. Add a "Condition" action to check if any items were retrieved from the riskcat list. Configure the condition with the following condition:
      • Choose the dynamic content for the "Get items" action's output, for example, body('Get_items')?['value'].
    5. Within the "If true" branch of the condition, add an "Update item" action to update the master list item. Configure the action with the following settings:
      • Site Address: Select the SharePoint site where the master list is located.
      • List Name: Select the master list.
      • ID: Select the ID of the current item from the trigger.
      • Set the desired values for the "riskclass" column based on the retrieved item from the riskcat list.
    6. Save and test the flow by creating or modifying an item in the master list.

    This flow will trigger whenever an item is created or modified in the master list. It will retrieve the corresponding item from the riskcat list based on the matching risk value. If a matching item is found, it will update the "riskclass" column in the master list with the corresponding value from the riskcat list.

    Note: Make sure to replace [master][risk] in the filter query with the appropriate dynamic content for the risk value from the master list.

    • smaharms-wende's avatar
      smaharms-wende
      Copper Contributor
      Hi NikolinoDE,
      thank's for your detailed reply. As soon as possible I'll try it.
      Best Regards

Resources