Skip to main content

Notifications

Community site session details

Community site session details

Session Id : zp6FYh9zhd419QUSk6gwi2
Power Automate - Building Flows
Suggested answer

copy column values from one list to another

Like (1) ShareShare
ReportReport
Posted on 16 Mar 2025 00:18:33 by 760 Super User 2025 Season 1
Hi I've been struggling with this for the whole day,
  • I need to copy values from one list to another
  • I have column_to_copy in both lists (same name)
  • there is a guid_colum in both of those lists in source list this is a unique record, in the destination list there is multiple records with the same guid_column values,
  • of course I'd like to update all of them with the column_to_copy values.

I've tried few things and even ended up with a flow that "worked" but it did absolutely nothing so clearly not correct.

I realise that this is probably a simple thing, and i can write that code in powerapps in a second but powerapps are extremely slow doing that kind of operations, it's only around 3000 records in this case but i need to learn that so i can use it on larger sets in the future.

All suggestions will be greatly appreciated.
Thank you!
  • Michael E. Gernaey Profile Picture
    36,184 Super User 2025 Season 1 on 16 Mar 2025 at 16:40:37
    copy column values from one list to another
    Hi @elseb
     
    FYI, I would not use a lookup, as there is no need.
     
    I would use an UpdateIf (instead of patch),  this way you only have a singular back-end action, versus grabbing the value and doing another patch.
     
    As for the Flow, if you build it the way I wrote it, it will give you what you want, of course no matter what, the more records you add the longer its going to take as it loops through everything.
     
    However, drilling down a little further, I guess the question or design thought I have is.
     
    How often do the records in ListA get udpated, so that you have to "re-update" rows in ListB?
     
    Does it make more sense to use a Trigger whenever a row is created or updated in ListA, so that you do NOT have to loop through all ListA records (except maybe the firs time to catch up), this way, its a simple Get Items on the ListB side based on the details coming in.
     
    I do not understand why you would do this over and over (but thats why I suggested the above, after doing a catch up), way better than constantly re-running this.
     
    Just curious also, why copy the data at all. You already have a mapping between the two and it appears that ListA would keep getting updated, so you will keep having to update ListB which seems like a lot of work for.... some particular reason. Is the value really that high for copying the data?
     
     
  • elseb Profile Picture
    760 Super User 2025 Season 1 on 16 Mar 2025 at 11:10:03
    copy column values from one list to another
    Hi Michael,
     
    Thank you very much for taking the time to answer, 
    Sorry about not posting my attempted flow, that question on here was out of desperation at this point :) 
     
    Just to clarify some things:
    I do use ID column but not in this case as this one has multiple uses.
    this is a training system I've built, when the new person is introduced i'm recording entra id of the person and this is used to track their records in several lists used by the system.
     
    I've had a situation for a period of time when the users introduced have not been setup in our AD yet, this caused me to add a temporary GUID generated by powerFX and the admin updates their account with an actual entra id once it's set up.
     
    to avoid updating all the lists when that's done i have used secondary column, e.g the main column person_uid is either entra id or generated GUID and that column is tracked around the system, the second column person_eid is always entra id and it's recorded either at the same time (if 365 account is ready) which is a dupe of the person_uid, or whenever the 365 account is set up and in that case it's different to person_uid. 
    Also to clarify, to for example display persons name i coalesce two an internal list which has a name of the person if the entra wasn't ready and office365userprofilev2 (reason being userprofile will reflect name changes etc.)

    all this is working beautifully, however there is a list with all the training courses each attended (record per) and i only recorded person_uid in that list, now the problem (kinda) arose when i needed to check the courses inside that list in report, i can obviously do a lookup but it would be quite elaborate and inefficient and it will be much easier to just add that column and record it from now.

    Also honestly this flow would be godsend for the future changes if something needs to be added in the same way.

    As for powerapps, code is a one liner however execution is absolutely dreadful, the first 5-10 records are almost instant than we go into a turtle mode to the point that the browser can time out.

    what i need would look like this in powerapps (quick and dirty, ignoring the delegation for now):
    ForAll(souce_list As sourceRecords, Patch(destination_list, LookUp(destination_list, person_uid=sourceRecords.person_uid),{person_eid:sourceRecords.person_eid}))
     
    as for the column type all is short string.
     
     
    TLDR;

    Thank you again, i will try to build the flow again and post it here to analyse what wi've messed up.
     
    Seb
     
      
  • Suggested answer
    Michael E. Gernaey Profile Picture
    36,184 Super User 2025 Season 1 on 16 Mar 2025 at 02:43:19
    copy column values from one list to another
    Hi @elseb
     
    So, its a little confusing so I want to restate and please bear with me, as I cannot see your data.
     
    1. You have 2 lists in SharePoint (same site or different sites?)
    2. You have a single column that you want to copy between the two
    What is the Column Type please
     
    3. You said - there is a guid_colum in both of those lists in source list this is a unique record
    Do you mean, you have a text column in List1, that is the unique ID for that Record?
    Curious, and totally cool to have a second one, but do you use the actual ID column (which is unique) for anything? just curious if we care about that
     
    Ok
     
    4. in the destination list there is multiple records with the same guid_column values
    So essentially this is a 1-Many relationships between the Source and the Destination (for whatever reason, its cool just making sure I read that correctly)
     
    5.  of course I'd like to update all of them with the column_to_copy values.
     
    So you have a Column in List1 (again please tell us the type), it has some value in it let's pretend it says IAM_Value1 and it maps to GUID 123456 (yeah I know that is not a guid)
     
    Now in List 2 you have 1-Many rows where you have a Column (Text probably) that has the value 123456 for the GUID
    • In that list you also have a Text Column which holds that value you want to copy
    • Let's pretend 6 rows in List 2 match GUID 123456
     
    You want the Text Column to be updated to be IAM_Value1 (which is my lame example)
     
    If that is correct please do this.
     
    Side note
    What's weird about your statement is, I would find doing it in a Canvas App for instance super fast as you would simply do
     
    ForAll(MyList1,
         UpdateIf(MystList2, GUIDText = ThisRecord.GUIDText, { ColumnText: ThisRecord.ColumnText } )
    )
     
    But maybe I am misunderstanding.
     
    Either way in Power Automate, the issue is you are going to have to loop through all the records to update them 1 by 1.
     
    Also, please note, please share your flows in the future so we can help you fix what you did, as we are a support, free doing, teaching, helping, we don't like doing all the work for people as we don't have time.
     
    Note: You didn't mention what would trigger this so I am going to write it as if you are going to do it 1 time and I'll mention doing it via Automation
     
    Steps 1
     
    1. Manual Trigger
    2. Get Items - where you will use List1
    3. Apply to each using the body/value Dynamic property output from Step 2
    --in side the Apply to each
    ----Get Items - filtering List 2 on the value from the current iteration of the Get Items from Step 2, aka current item or item()
    ------Apply to each
    --------inside apply to each
    ----------update item using the value from the Step 2 Get Items to update your column for every row pulled back in this Get Items
     
    Bulk update
     
    now if you want to avoid looping through them and depending on exactly what you want to update, you can look at using the Send HTTP Request to SharePoint Action to send bulk updates.
    but you still have to find, and build the batch request before sending it, so its not going to remove ALL the steps above, its going to, at best, remove you calling update for each item and instead grabbing that data and shaping it into a bulk request with a whole bunch of stuff and limitations bla bla.
     
     

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,442 Most Valuable Professional

Leaderboard
Loading started