How to Copy Popup Text to a Selected Power Apps Gallery Item
Question details
The user needs to update a specific record in a Power Apps gallery with text that is inputted via a separate popup window.

- Product
- Microsoft Power Apps
- Device & OS
- not provided
- Scenario
- Entering text into a popup text field and saving that data back to the currently selected item in a Power Apps gallery upon confirmation.
- Observed behavior
- The user needs the correct formula and logic to ensure the text from the popup correctly targets and updates the selected gallery record's specific field.
Ensure your Power Apps gallery data source includes a unique identifier (like an ID column) to accurately target the selected record for updates.
Use the UpdateIf Function to Target the Selected Gallery Item
Utilize a variable or control reference to capture the popup text and the UpdateIf function to apply it to the matching gallery record based on its unique ID.
To update a specific gallery item from a popup, you need to match the unique ID of the selected gallery item with the ID of the record in your data source. The UpdateIf function is ideal for applying conditional updates to an existing data set.
Create a text-input control in your popup window (e.g., named 'PopupTextField') or store the input text in a global variable to capture the user's input.
Navigate to the button control in your popup that users will click to confirm and save their entered text.
In the 'OnSelect' property of the confirmation button, enter the formula: UpdateIf(Gallery7_1, ID = Gallery7_1.Selected.ID, {Header1: PopupTextField})
Ensure that 'PopupTextField', 'Gallery7_1', and 'Header1' are replaced with the actual names of your text control, target gallery, and the specific field you wish to update.

Looking for a Free and Powerful Office Suite? Try WPS Office
While managing your applications and data in the Microsoft ecosystem, you might need a reliable and cost-effective office suite for your daily documentation. WPS Office provides a lightweight, fully compatible, and free alternative to Microsoft Office.
- 1. Download WPS Office: Visit the official WPS website to download the free installation package for your operating system.
- 2. Install the application: Run the downloaded installer and follow the simple on-screen instructions to complete the setup.
- 3. Open your files: Launch WPS Office and open your existing Microsoft Office documents directly without worrying about formatting loss.

Frequently Asked Questions
Why isn't my Power Apps gallery item updating when I click the popup confirmation button?
This usually happens if the data source doesn't have a unique ID, or if the formula doesn't correctly match the ID of the selected gallery item. Ensure 'ID = Gallery7_1.Selected.ID' is pointing to the correct unique identifier in your data source.
Can I update multiple fields in a Power Apps gallery at once?
Yes. In the UpdateIf function, you can update multiple fields by passing them within the curly braces separated by commas, such as: {Header1: PopupTextField, Subtitle1: AnotherFieldControl}.
What is the difference between UpdateIf and Patch in Power Apps?
UpdateIf modifies one or more records in a data source that match a specific condition (like matching an ID). Patch is typically used to create a new record or modify a specific single record explicitly by passing the record reference.




