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 / Append Text Input to m...
Power Apps
Unanswered

Append Text Input to multiple selected fields

(0) ShareShare
ReportReport
Posted on by 8
I'm stuck on trying to append a text input to multiple fields in my Power App.
 
I have a screen in which the user can select numerous users they need to add the same data to and pass that as a collection to the next screen. On this new screen, the user needs to be able to input a text value that will modify the "tracking number" field for each selected user. After modifying the collection with this data, I need to patch it back to the source file. Is this possible? 
 
I've attached a picture to show what I currently have. The "0" being displayed for each selected option is the current tracking data from the form, with the next number being the unique ID, and I've removed the names from below that to post onto this board.
 
I'm a complete novice at Power Apps and have been able to research everything and make my way through this app creation, but I cannot seem to figure this one out so I appreciate any input. 
Categories:
I have the same question (0)
  • Suggested answer
    MS.Ragavendar Profile Picture
    4,975 Super User 2025 Season 2 on at
    Sample Wire frame
     
     
    The selection of users use gallery control, if you need to enhance you can use the search by adding textbox accordingly.
     
    Next Button (onSelect)
     
    ClearCollect(colSelectedUsers, GalleryUsers.SelectedItems);
     
    Navigate(Screen_TrackingNumber, ScreenTransition.Fade)
     
    Screen_TrackingNumber
     
     
     
    Update Button Formula
     
    ForAll(colSelectedUsers, 
        Patch(colSelectedUsers, ThisRecord, {TrackingNumber: txtTrackingNumber.Text})
    );
    ForAll(colSelectedUsers, 
        Patch(SourceData, LookUp(SourceData, ID = ThisRecord.ID), {TrackingNumber: ThisRecord.TrackingNumber})
    );
     
    Navigate(Screen_Confirmation, ScreenTransition.Fade)
     
    Hope this will helps!
     
     
  • CU26020834-0 Profile Picture
    8 on at
    I receive the following error message on the first part of the code for the button update formula:
     
    "This function cannot operate on the same data source that is used in ForAll"
     
    Do I need to break this into another step to get there instead of trying to do it all at once?
  • MS.Ragavendar Profile Picture
    4,975 Super User 2025 Season 2 on at
    Can you please post the formula 
  • CU26020834-0 Profile Picture
    8 on at
    ForAll(colTrackingSelect, 
        Patch(colTrackingSelect, ThisRecord, {'Tracking Number': TextInput1.Text})
    );
    ForAll(colTrackingSelect, 
        Patch(NVLog, LookUp(NVLog, 'Tracking Numebr' = ThisRecord.'Tracking Number'), {'Tracking Number': ThisRecord.'Tracking Number'})
    );
     
     
    I modified the formula suggested with the appropriate field names I have and the first Patch function in the formula returns that error message: "This function cannot operate on the same data source that is used in ForAll"
     
  • MS.Ragavendar Profile Picture
    4,975 Super User 2025 Season 2 on at
    ForAll(colTrackingSelect, 
        Patch(colTrackingSelect, ThisRecord, {'Tracking Number': TextInput1.Text})
    );
     
    Instead of modifying the collection within ForAll, use Collect or AddColumns to create an updated version.
     
    ClearCollect(colUpdatedTracking, 
        AddColumns(colTrackingSelect, "UpdatedTrackingNumber", TextInput1.Text)
    );

     
    ---------------------------------------------------------------------------
     
    Data source patching
     
     
    ForAll(colUpdatedTracking, 
        Patch(NVLog, 
            LookUp(NVLog, 'Tracking Number' = ThisRecord.'Tracking Number'), 
            {'Tracking Number': ThisRecord.UpdatedTrackingNumber}
        )
    );
     
     
     
  • CU26020834-0 Profile Picture
    8 on at
    Ok, maybe I'm doing something wrong. Now it is appending the data, but only to the 1st row of the data source instead of to the row relating to the asset record.
     
    The second collection with the adding of columns is working now and I can see that data.
     
    ForAll(colUpdatedTracking,
        Patch(NVLog,
            LookUp(NVLog, 'Tracking Number' = ThisRecord.'Tracking Number'), {'Tracking Number': ThisRecord.UpdatedTrackingNumber})
    ); Navigate(SuccessfulScreen)
     
    I think I'm missing something to force it to append this data to every field that was selected. I truly appreciate all the help, not my area of expertise.
  • CU26020834-0 Profile Picture
    8 on at
    Any ideas why this patch function is only appending the data to the top row in my data source instead of all the selected ones? 

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard