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 / Getting Form field fro...
Power Apps
Answered

Getting Form field from either of the selected Gallery

(0) ShareShare
ReportReport
Posted on by 118

Hi,

 

I have two galleries in one screen, Gallery1 & Gallery2. Both the Galleres item when selected navigate to the same Screen with form Form1. User can select item from only one of the Gallery at a time. The field that needs to be populated eg. "txtbrand" in Form1 should have a value from either of the selected Gallery.

I know how to do it with one Gallery item as Default but stuck with this situation

I hope to get a quick solution on this

Thank you

Categories:
  • Verified answer
    Florian_Kleinz Profile Picture
    227 on at

    Hello,

     

    Do Gallery1 and Gallery2 refer to the same DataSource?

     

    You could set a variable to either Set(variable,Gallery1.Selected) or Set(variable,Gallery2.Selected) and use this variable as item property for your Form. In case of different DataSources you probably need to pass DataSources as well.

     

    Best regards

    Florian

  • eka24 Profile Picture
    20,925 on at

    Whlie agree with @Florian_Kleinz , you can also insert a button and create an UpdateContext that would change from one Gallery to the other when the button is pressed UpdateContext({ChangeGal1:!ChangeGal})

     

    Then on the Item of the Form1 put

    If(ChangeGal,Gallery1.Selected, Gallery2.Selected)
    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

     

     

  • shoebwk Profile Picture
    118 on at

    Yes, both galleries has filter data from the same SP list.

  • shoebwk Profile Picture
    118 on at

    Hi,

     

    This is still not clear to me. Could you show me  as an example in a proper command ?

  • eka24 Profile Picture
    20,925 on at
    On the Button
    UpdateContext({ChangeGal:!ChangeGal})

     

    Button.PNG

     

    If(ChangeGal,Gallery4.Selected,Gallery5.Selected)

     

    Form1.PNG

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • shoebwk Profile Picture
    118 on at

    Florian's solution makes more sense without any manual intervention. It worked for me witth the following command

     

    Set(VarRecord,ThisItem);NewForm(Form4);Navigate(Screen2,ScreenTransition.None)

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 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard