cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How do I get specific value for a control in a Gallery?

I created a gallery that I am using as a check list.  I notice when I edit the gallery and use insert to create a control within the gallery, it creates the same control for each item on my list. 

 

Current example:

 

SAMPLE.jpg

 

I have a label I am using for testing purposes to get the value of a radio button control.  When I click on fail, or pass in the radio button selection, it changes the value in my label to what is selected.  This is fine. 

 

The problem is that if I go to the second, third, etc item on the list, it changes the value in the label.  I need my label to specifically get the control value from the first item on the list and only that value. 

 

Then I want to make another label and that should only get the value of the second radio button value, and should not change the value if other buttons are changed and so on.  Each item in my checklist should only be able to affect it's own radio control and receive that value

 

How would I accomplish this type of behavior?  So far I have the following code:

 

label_Tester.Text = radio_Result_TS.Selected.Value

 

My radio button (radio_Result_TS) in the Gallery (Gallery_1)  has the default code.  OnSelect -> Select(Parent)

 

Thanks for any help or insight. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Anonymous :

Do you want to get the choice of redio control in the first and second items in the gallery.

The point is using 

 

GalleryName.AllItems

 

I'v made a test for your reference:

1\Add a gallery(Gallery1)

2\Add a Radio control into this gallery(Radio2)

First item:

 

First(Gallery1.AllItems).Radio2.Selected.Value

 

Second item:

 

Last(FirstN(Gallery1.AllItems,2)).Radio2.Selected.Value

 

67.gif

Best Regards,

Bof

 

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @Anonymous :

Do you want to get the choice of redio control in the first and second items in the gallery.

The point is using 

 

GalleryName.AllItems

 

I'v made a test for your reference:

1\Add a gallery(Gallery1)

2\Add a Radio control into this gallery(Radio2)

First item:

 

First(Gallery1.AllItems).Radio2.Selected.Value

 

Second item:

 

Last(FirstN(Gallery1.AllItems,2)).Radio2.Selected.Value

 

67.gif

Best Regards,

Bof

 

Anonymous
Not applicable

Thanks Bof worked like a charm and this is exactly what I am looking for thank you so much.  I will also look into these functions more in the future to see what else they can do. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,326)