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 Apps / Copy One column data t...
Power Apps
Answered

Copy One column data to another column in collection

(1) ShareShare
ReportReport
Posted on by 108

Hi Experts,

 

Below is my data source,

suriyamv07_0-1693941864916.png

I would like to perform bulk update here. Using checkbox option, i could do the multi select. 

 Here i need to copy the content from "Program" column to "Activity" column for the selected alone.  I am using the below formula 

UpdateIf(
 colBulkUpdateCheckbox,
 true, 
 {
 'Choice': input2.Selected,
 Activity: LookUp(colBulkUpdateCheckbox, ID = ThisRecord.ID , Program)
 }
);
Patch(
 'data_source_sharepoint_list',
 colBulkUpdateCheckbox
);

If i use the above formula, it copying the selected first rows program data to all the selected rows of activity column. Could anyone please help on doing the exact copy of Program to Activity column.

 

And also i would like to upload single attachment file for the selected items . Please provide thoughts on how to upload attachment to bulk items.

Categories:
I have the same question (0)
  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    The issue with your UpdateIf formula is that it's using a LookUp that essentially takes the 'Program' from the first record with the ID matching ThisRecord.ID. That's why you're getting the first row's data copied to all the selected rows.

    You can update your formula to remove the LookUp function and directly use ThisRecord.Program to copy the content from "Program" to "Activity":

    UpdateIf(
     colBulkUpdateCheckbox,
     IsBlank(Activity) && Checkbox1.Value, // Checkbox1.Value would be your column with checkboxes
     {
     Activity: ThisRecord.Program
     }
    );
    

    After this, you can patch the data back to SharePoint:

    Patch(
     'data_source_sharepoint_list',
     ForAll(
     colBulkUpdateCheckbox,
     {
     ID: ThisRecord.ID,
     'Choice': ThisRecord.Choice,
     Activity: ThisRecord.Activity
     }
     )
    );
    


    For the file attachment portion, things get a bit tricky.

    In Power Automate, you can create a Flow that accepts a table of IDs and FileContents from Power Apps. Inside the Flow, you can use a "For each" loop to go through each item and attach the file to the SharePoint list.

    1. Create a Flow in Power Automate
      Create a Flow that accepts a table of data with ID and FileContent as inputs. Use a "For each" loop in the Flow to loop through the table and attach a file to each SharePoint list item with the corresponding ID.

    2. Trigger the Flow in Power Apps
      In Power Apps, prepare a collection of selected items with ID and FileContent and then send this collection to the Flow.

    Here's a pseudo-formula to collect IDs and FileContents of selected items:

    ClearCollect(
     colSelectedItemsWithFile,
     Filter(
     colBulkUpdateCheckbox,
     Checkbox1.Value = true
     )
    );
    

    And then run the Flow:

    YourFlowName.Run(colSelectedItemsWithFile)
    

    The one with the File Attachment is separate. I almost would say if the top part worked for you, that you consider this one resolved and bring your second issue as separate thread as the second issue is much more complex and is distinct from the first and involves use of both Power Automate and Power Apps. I would suggest also you post for the 2nd one in both this forum and the Power Automate forums as well in case.


    See if any of this helps @suriyamv07 

     

  • suriyamv07 Profile Picture
    108 on at

    @poweractivate  I have applied the first scenario's suggested solution and it worked perfectly. Thanks a lot. 

     

    For the second scenario, could you please share some reference power automate flow to get id, attachment as input from powerapps.

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard