Forum Discussion

Mihiranp's avatar
Mihiranp
Copper Contributor
Mar 12, 2024

Update changes between two SharePoint Lists

I have two List as below

one for Ticketing and another for Test Ticketing. I need to ensure that if I update a specific customer's information in the Ticketing list, the same changes are reflected in the Test Ticketing list. If the record does not exist in the Test Ticketing list, it should be created as a new entry.So i created flow as below

 

 

 

 

 

 

 

 

 

 

 

 

tested the flow and found that item creation was not working

5 Replies

  • Mihiranp 

    Alternatively, you can fulfill this requirement with few steps. Check and let me know if this works for you.
    1)Following a trigger'When an item or file is modified'
    2)Use the 'Get Item' and Set the Site Address and List Name for Test Ticketing list, In the Filter Query field, enter the condition to match the column in Test Ticketing list with the Ticketing list.

    Title eq 'triggerOutputs()?['body/Title']'
    3)Add a Condition which verifies whether the length of the retrieved items from SharePoint is greater than zero. If it is, it updates the existing data in the SharePoint list; otherwise, it creates a new item.

    length(outputs('Get_items')?['body/value'])

     

    If this solution proves helpful and resolves your issue, kindly consider marking it as accepted. Doing so will aid others who encounter similar challenges in the future.

    Regards,
    NarasimaPerumal Chandramoha
    Microsoft MVP
    Apps4.Pro - Trusted Office365 T2T Migration partner. Migrate Exchange, SharePoint, Microsoft Teams, Stream, Yammer, Power Platform between tenants.
    Product Specialist - http://www.apps4.pro/

    • Mihiranp's avatar
      Mihiranp
      Copper Contributor

      NarasimaPerumal Chandramohan
      I have created the flow as above but facing an error once the item creating

       

      this is my get item filter

       

      this my condition

      length(outputs('Get_items')?['body/value'])
       
      greater than zero
      • Mihiranp 

        The 'Create item' action should not be nested within the apply to each loop. I observed that you've dynamically used values from the 'Get items' action to create the item. However, you should incorporate values directly from the trigger 'When an item or file is modified', since it is the new item.