Forum Discussion

Mihiranp's avatar
Mihiranp
Copper Contributor
Mar 11, 2024

Update changes between two SharePoint List

Hi,

I have two Microsoft lists - one for all customer tickets and another for customer information. I need to ensure that if I update a specific customer's information in the all-customer tickets list, the same changes are reflected in the customer information list. If the record does not exist in the customer information list, it should be created as a new entry.

  • Mihiranp you will need to build a flow in Power Automate.

     

    These are the 2 SharePoint lists.

     

    The flow is as follows:

     

     

     

    If one of those 3 columns has changed then get all the items from the CustomerInfo list. If it was a different column that changed then do nothing.

     

     

    Condition 2 below looks at whether the Title column from the get items action is equal to the CustomerEmail column in the CustomerTickets list. If it is set the boolean variable created earlier to the expression true.

     

     

    Outside the apply to each add another condition to check if the variable is true. If it is, update the item in the CustomerInfo list, if not create a new item.

     

     

    In the CustomerTickets list I changed the Isalnd to Guadalupe, the flow then ran and the Island in CustomerInfo was updated to Guadalupe.

     

     

    I would then have a second flow with the when an item is created trigger. Otherwise you have to add more actions (and complexity) to this flow to avoid the never-ending loop where an item is constantly updated.

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User.
    Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)

  • Rob_Elliott's avatar
    Rob_Elliott
    Bronze Contributor

    Mihiranp you will need to build a flow in Power Automate.

     

    These are the 2 SharePoint lists.

     

    The flow is as follows:

     

     

     

    If one of those 3 columns has changed then get all the items from the CustomerInfo list. If it was a different column that changed then do nothing.

     

     

    Condition 2 below looks at whether the Title column from the get items action is equal to the CustomerEmail column in the CustomerTickets list. If it is set the boolean variable created earlier to the expression true.

     

     

    Outside the apply to each add another condition to check if the variable is true. If it is, update the item in the CustomerInfo list, if not create a new item.

     

     

    In the CustomerTickets list I changed the Isalnd to Guadalupe, the flow then ran and the Island in CustomerInfo was updated to Guadalupe.

     

     

    I would then have a second flow with the when an item is created trigger. Otherwise you have to add more actions (and complexity) to this flow to avoid the never-ending loop where an item is constantly updated.

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User.
    Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)

    • Mihiranp's avatar
      Mihiranp
      Copper Contributor

      Rob_Elliott 

      I have created as below

       

       

       

       

       

       

       

      Flow run successfully but item not created below is test result

       

       

    • Mihiranp's avatar
      Mihiranp
      Copper Contributor

      Rob_Elliott 

       

      Hi,
      When updating an item in the main list, a new item is created successfully in the second list if it doesn't already exist. However, if the item already exists in the second list, a new item is created instead of updating the existing item

       

       

Resources