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 / Gallery selection to t...
Power Apps
Unanswered

Gallery selection to text input box

(0) ShareShare
ReportReport
Posted on by 19

Hi There, 

 

I currently have a white text input box that when you input a users name, it searches office 365 users and display the results (green gallery). The issue I have is I don't know how to 'on select' or when I click or tap 'James Warren' for it clear out the white text input box and put in James Warren as a selection. I have tried collection and setting variables but I just can't figure it out, this is my first ever power app. Any help would be appreciated!

 

list.jpg

Categories:
I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    @mauvis99 

     

    - Give this in the Items property of the gallery

    If(!IsBlank(TextInput1.Text), Filter(tblSkyscrapers, TextInput1.Text in 'Building Name'),tblSkyscrapers)

     

    VJR_0-1663213981451.png

     

    - In the OnSelect of the Gallery set a variable called varSelectedText to the gallery's selected item only if it is selected 

     

    If(ThisItem.IsSelected,Set(varSelectedText,ThisItem.'Building Name'),Set(varSelectedText,TextInput1.Text))

     

     

    - In the Textbox's Default property pass that variable.

     

    VJR_1-1663214201964.png

     

    - After clicking, it works as below

    Does not show other records of the gallery. They will show only after the user clears the text box. This is because as per your requirements the gallery items are dependent on the value of the text box and the value of the textbox is dependent on the gallery items.

    You can add a button to Reset.

     

    VJR_2-1663214259498.png

     

    This might become a bit cumbersome to have a circular reference like thing to have dependency of two controls on one another, but if it is fine with you then great :).

     

     

  • mauvis99 Profile Picture
    19 on at

    Hi there, thanks for the response, it gave me some clues as to what to do.

     

    So I set the Data > Default property of the Text Box to:  selectedText

    Then  for the Gallery 'On Select' property I wrote the following, it now works!! cheeehooo!!

    If(ThisItem.IsSelected, Set(selectedText, ThisItem.DisplayName) , Reset(TextBox))

     

    Also, it only worked when the Advanced > Display Mode property for the Gallery was set to:  DisplayMode.Edit   it didn't work when it was set to DisplayMode.View

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard