web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create item and update...
Power Automate
Unanswered

Create item and update item

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I'm trying to make a flow in which when an item is created or modified from List 1 it creates List 2 but if List 1 I would like for List 2 to update.

 

Right now when I modify list 1 it creates a duplicate in list 2 and I dont want that. I want for the one in list 2 to update only.

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    Can you please post a screenshot of the current flow? 

     

    You can use the Update Item in sharepoint action to update the item in list 2 whenever an item is updated in List 2. 

     

    You can add a get items action after the trigger and modify the filter query to get the items that match some unique value in List 2 from List1. Only if there is a match you will get just one value and you can update it in case of updating and the item already exists. Now if the item is new, you can check the length of the items retrieved in the get items and if it is 0 create a new item in list 2. (Makes sense?)

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • ScottShearer Profile Picture
    25,278 Most Valuable Professional on at

    @Anonymous 

    I agree with @yashag2255 - he  mentioned that you need to be able to identify items in list 2 that relate to items in list 1.  I suggest adding a column to list 2 where you'll store the ID of the item from list 1.  That will make it easy to identify what item in list 2 should be updated when an item in list 1 is updated via the filter query/OData filter.

     

  • Community Power Platform Member Profile Picture
    on at

    @yashag2255 @ScottShearer 

     

    can you please show me how that would look? This is what I have so farflow.PNG

  • ScottShearer Profile Picture
    25,278 Most Valuable Professional on at

    @Anonymous 

    Please see my screen shots below.

    I use two lists - List A and List B.  I added a column to ListB called ListAID to store the ID of the corresponding entry in List A.  The column that I added is a number with zero decimals.

    My GetItems action for ListB uses a Filter Query so that only items that correspond to to the entry in ListA are returned (there should either be one or none).  Note the single quotes around the ID in the filter query.

     

    If no items are returned, I create a new item.

    If there is an item returned, I update that item.

    SyncLists1.jpgSyncLists2.jpg

     

     

  • Community Power Platform Member Profile Picture
    on at

    @ScottShearer Can you show how the flow will look if I have to only create items from List A to list B if the field Location equals "Florida".

     

    I only want list B to get items from list A that have the location field set as "Florida"

  • ScottShearer Profile Picture
    25,278 Most Valuable Professional on at

    @Anonymous :

     

    To limit to entries where the location field is Florida, simply add the following to the filter query:

    and Location eq 'Florida'

     

    LocFilterQuery.jpg

     

    If you don't want to create items unless the Location is Florida, you'll want to put in a condition that cheks for that at the top of your Flow - if the lcoation ins't Florida then exit your Flow with a Control Terminate action.  So, if no entries exist other than those in Florida, you don't need to check for that in your filter query - it can stay unchanged.

     

     

     

     

  • ktmbob Profile Picture
    14 on at

    Hi @ScottShearer ,

    I am pretty sure I have done everything correctly in my flow:

     

    List A - 41G Schedule

    List B - 41G Monthly

     

    I have added the column (number w/ 0 decimals) to List B called 41GScheduleID to capture List A ID.

     

    The error I get in the flow is this:

    BadRequest

    "status": 400,
    "message": "The expression \"41GScheduleID eq '282'\" is not valid.\r\nclientRequestId: ec554315-3b7a-4e6b-b82c-6e3884ea0580\r\nserviceRequestId: ec554315-3b7a-4e6b-b82c-6e3884ea0580"

     

    ...and its in the Get Items part.

     

    My flow:

    flow1_1.JPGflow2_1.JPG

     

    Any ideas?  Thanks.

  • ScottShearer Profile Picture
    25,278 Most Valuable Professional on at
    @jtmbob :
    Remove the quotes around the number (282) - no quotes for numbers.

  • ktmbob Profile Picture
    14 on at

    Hi @ScottShearer ,

    Thanks for the quick reply. 

     

    I tried that and now got the following error still in the 'Get items' part:

     

    {
    "status": 400,
    "message": "The expression \"41GScheduleID eq 291\" is not valid.\r\nclientRequestId: 7a4dfcbf-bcd0-439f-b172-bb874c10f43c\r\nserviceRequestId: 7a4dfcbf-bcd0-439f-b172-bb874c10f43c"
    }

     

     

  • ktmbob Profile Picture
    14 on at

    Changed a couple things and it worked!

     

    I abandoned trying to filter by ID number and moved to 'Job Title' like this:

     

    flow4.JPG

     

    The condition checked for the Job Title as empty (0) and was written like this: equals(length(body('Get_items')?['value']), 0)

     

    Please also note that the space in between Job and Title must be replced with _x0020_ .

     

    Works perfectly.  Thanks to all above for the help!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 315 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 273 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 117 Super User 2026 Season 1

Last 30 days Overall leaderboard