cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mike87
Frequent Visitor

Refreshing Problems

Hi

I am using a Textinput field as a Search box to filter a Gallery Control. The callery control gets data from Dynamics 365. 

The behaviour of the control is buggy, so while I am typing in the search box it refresh several times. 

the user can choose an item from the control and get to the next screen.

Now if he is fast and select an item, while the control is still refreshing, the selected item is changed whil the user is already on the next screen.

 

I think as a solution, that I want the gallery items only to load when the user clicks on a button, and not while typing in the textbox.

any idea how I can do this?

thanks for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

You can do this with the UpdateContext() function. Copy the entire Items property from the galley and in the magnifying glass icon's OnSelect put UpdateContext({srch: paste Items property here })
Replace the Items property of the gallery with srch. Now the galley will stay empty until you click the magnifying glass icon. If you click the icon when the textbox is empty, the galley should fill wth all the Items.
If you want the gallery filled by default, set the OnVisible property of the screen to Select(icon name here). The Select() Function activates the OnSelect property of another control programmatically.

View solution in original post

4 REPLIES 4
Drrickryp
Super User
Super User

You can do this with the UpdateContext() function. Copy the entire Items property from the galley and in the magnifying glass icon's OnSelect put UpdateContext({srch: paste Items property here })
Replace the Items property of the gallery with srch. Now the galley will stay empty until you click the magnifying glass icon. If you click the icon when the textbox is empty, the galley should fill wth all the Items.
If you want the gallery filled by default, set the OnVisible property of the screen to Select(icon name here). The Select() Function activates the OnSelect property of another control programmatically.
mike87
Frequent Visitor

thank you, but it seems that its not working.

maybe because I use Filter and not search?

this is the command I have currently in the items value:Sort(If(CustomerSearch.Text<>"";Filter(Firmen; CustomerSearch.Text in Firmenname);FirstN(Firmen;10));Firmenname;Ascending)

if it works in the galley it should work in the icon since the context variable is an Alias for the Items property.
mike87
Frequent Visitor

it worked. thank you!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (6,535)