cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kriggo15
Level 8

Populate Text Input Box from Gallery Item

I have a search box that is used to filter a gallery. When the user chooses an item from the gallery, I want the text box to contain that chosen item.

SearchInput1.png

 

How do I accomplish this?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Populate Text Input Box from Gallery Item

@kriggo15 

If you require that functionality I will need to refine my suggestion.  See below.

 

--REVISED SOLUTION--

 

Change your gallery Items code to include a variable reference to mySearchedValue instead of the Text Input.

 

Sort(Search(TestList.Value, TextInput1.Text, "Value"), Value, Ascending)

 

Put this code in the OnSelect property of the gallery.

 

Set(mySearchedValue, TextInput1.Text);
Reset(TextInput1);

 

Finally, the Default property of the Text Input should be

 

mySearchedValue

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

7 REPLIES 7
Super User
Super User

Re: Populate Text Input Box from Gallery Item

@kriggo15 

Put this code in the Default property of the Text Input

Gallery1.Selected.your_field_name

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

kriggo15
Level 8

Re: Populate Text Input Box from Gallery Item

@mdevaney 

I'm getting a circular reference error:

SearchInput2.png

 

I'm assuming it is because I'm using the search box to filter my gallery:

SearchInput3.png

 

Super User
Super User

Re: Populate Text Input Box from Gallery Item

@kriggo15

Yes, the circular reference is occurring for exactly the reason you described.  With this new information I would suggest a different approach.

 

Change your gallery Items code to include a variable reference to mySearchedValue instead of the Text Input.

Sort(Search(TestList.Value, mySearchedValue, "Value"), Value, Ascending)

 

Also put this code in the OnSelect property of the gallery.

Reset(TextInput1.Text)

 

Then for the the OnSelect property of your Search button use this.

Set(mySearchedValue, TextInput1.Text)

 

Finally, the Default property of the Text Input should be

mySearchedValue

 

kbilakanti
Level 8

Re: Populate Text Input Box from Gallery Item

Hi, please find the screenshots attached as per your requirement.

 

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

kriggo15
Level 8

Re: Populate Text Input Box from Gallery Item

@mdevaney, we're very close. 

 

The gallery list is not filtering when typing in the TextInput1 Box:

SearchInput4.png

 

Super User
Super User

Re: Populate Text Input Box from Gallery Item

@kriggo15 

If you require that functionality I will need to refine my suggestion.  See below.

 

--REVISED SOLUTION--

 

Change your gallery Items code to include a variable reference to mySearchedValue instead of the Text Input.

 

Sort(Search(TestList.Value, TextInput1.Text, "Value"), Value, Ascending)

 

Put this code in the OnSelect property of the gallery.

 

Set(mySearchedValue, TextInput1.Text);
Reset(TextInput1);

 

Finally, the Default property of the Text Input should be

 

mySearchedValue

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

kriggo15
Level 8

Re: Populate Text Input Box from Gallery Item

@mdevaney  as always, much appreciated!

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,363)