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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Adding label text from...
Power Apps
Answered

Adding label text from outside Gallery

(0) ShareShare
ReportReport
Posted on by 244

Hi Power Apps Community

 

TL;DR: How do i make the "Add"-button set the text of a label in the selected row?

 

I'm trying to create an app for maintenance registration, where users on a daily basis register temperatures, tasks and so forth.

I've created a gallery, which shows tasks for certain departments and specific routines, with ranges of allowed values.

In all cases, the user only has to input one value, which is then patched with the task-specific details to its own CDS table.

 

Now I'm trying to add the option to add comments to values out of range, through a "pop-up". How can i add a new specific value to a specific line, from outside the gallery (same page)?

 

I thought about writing the comment into a hidden label or input field, but cant figure out how to target the specific field.

(The comment is added through a button, so i can use "Selected", if that makes any difference.)

 

powerappscomment.png

 

 

Categories:
  • WarrenBelz Profile Picture
    156,763 Most Valuable Professional on at

    Hi @Daniel_Pa ,

    Set a Variable on the Add Button

    UpdateContext({varTask:YourTextBoxName.Text})

    and then the Default of the box in the gallery

    If(
     ThisItem.IsSelected,
     varTask
    )
    

    Also ensure you set varTask to Blank() before you select another item, or it too will default to this.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • Daniel_Pa Profile Picture
    244 on at

    Hi WarrenBelz

     

    Thank you for the swift reply.

    Have you tested this? Will it work for adding comments to several rows before submitting?

    I'm having a bit of an issue with the text jumping between the lines, when selecting rows, as you stated. Even when i Set the variable to Blank().

     

    I might have missed the fact that the user will fill out most of the tasks, before submitting. Thus, I'd like to have different comment on several lines possibly.

     

  • WarrenBelz Profile Picture
    156,763 Most Valuable Professional on at

    Hi @Daniel_Pa ,

    I leave the testing to you (or I would help less people . . .). If you want it to work on several rows, you need to get rid of ThisItem.IsSelected and simply make it varTask. (EDIT Disregard). There is no other way of doing it with a gallery control other than the Default property and galleries have a bad habit of resetting when something is run from inside them.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

     

  • Daniel_Pa Profile Picture
    244 on at

    Hi WarrenBelz

     

    No problem - I'm happy to test it, just wanted to make sure there was a possibility that it wasn't working as expected, to ensure I hadn't done something wrong.

    I really appreciate the help.

     

    Getting rid of IsSelected, just doubles the comment to all rows.

     

    I'd also be open to suggestions on how to achieve the desired outcome through other means - the comment pop-up was just my workaround, since i couldn't fit a large enough input box into the gallery.

  • WarrenBelz Profile Picture
    156,763 Most Valuable Professional on at

    @Daniel_Pa ,

    Yes you are correct on the IsSelected - it needs to be left as is (I have edited the post as well). What you are doing is a bit unusual, but the Default is the only way of "remote populating" a control and a gallery is made more difficult as there are several controls with the same name (so ThisItem.IsSelected is the only way of identifying the one you want) and you cannot remotely reset the control as you can do with others. Also as I mentioned, running a function from within a gallery has the potential to reset everything in the gallery.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Verified answer
    Daniel_Pa Profile Picture
    244 on at

    Hi WarrenBelz

     

    I found another way of achieving the desired outcome.

    I add the comment to a Collection, with a name-column based on the other values from the row.

    I can the set the text of a hidden label as a LookUp, again based on the combined values from the row, and use that to store the comment for the row and finally Patch it together with the rest of the values, when the user submits.

     

    Thanks for the input still! 🙂

     

  • v-jefferni Profile Picture
    Microsoft Employee on at

     Hi @Daniel_Pa ,

     

    Good to know you have found the solution! Please consider accepting your own reply as the solution help the other members find it. 

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard