cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kumar9024021
Level: Powered On

Autocomplete textbox doesn't work

I am building an autocomplete textbox control in Powerapps, using SharePoint as a datasource.

 

I have added a Gallery below the textbox. OnSelect,OnChange of the textbox, I have set the Gallery visibility flag to true.

 

UpdateContext({showgalleryflag:true});

 

 Screenshot.PNG

 

In the Gallery, Items property, I have populated the datasource as below

 

If(Not(DataCardValue5.Text=""),Filter('DS',DataCardValue5.Text in Event));

 

In the Gallery, OnSelect,

 

UpdateContext({showgalleryflag:false,Event:ThisItem.Event});

 

In the Gallery, Visible

 

showgalleryflag

 

Still i notice, that the autocomplete doesn't work. The Gallery doesn't shows up, even when the Event is changed/selected.

 

Any technical advice would be helpful. Thanks.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Autocomplete textbox doesn't work

Hi @Kumar9024021 

 

Can you please confirm that the "Default" property of the textbox is set to Event variable?

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

13 REPLIES 13
Power Apps Staff Mr-Dang-MSFT
Power Apps Staff

Re: Autocomplete textbox doesn't work

Hi @Kumar9024021 ,

It sounds like you have a gallery that you want to populate with options that match the text typed into the field. The "in" operator is non-delegable with SharePoint and is resulting in options not appearing that you may expect.

 

Instead, I suggest restructuring your filter:

If(
    !IsBlank(DataCardValue5.Text),
    Filter('DS',
        StartsWith(Event,DataCardValue5.Text)
    )
)

 

This means, "If the text in the input field is NOT blank, Filter the 'DS' table to show all Events that start with the given string."

 

I would also check to make sure the text input field has a Default of "" instead of completely blank as both are treated differently.

 

Let me know if this was the case.

 

Mr. Dang

Kumar9024021
Level: Powered On

Re: Autocomplete textbox doesn't work

Hi @Mr-Dang-MSFT ,

 

Thanks for the response. I noticed that the auto-complete now works.

 

  1. Scr1.PNG

 

When I key-in text Sam in the textbox, I can see Sample1, Sample2 which is correct. However when I select Sample2 from the auto-complete results, it doesn't gets selected. If i click on Sample2, it should appear in the Event textbox.

 

Also, I notice the autocomplete results overlap other fields adjacent to it. Anyway we can avoid this ?

Power Apps Staff Mr-Dang-MSFT
Power Apps Staff

Re: Autocomplete textbox doesn't work


@Kumar9024021 wrote:

Hi @Mr-Dang-MSFT ,

 

Thanks for the response. I noticed that the auto-complete now works.

 

  1. Scr1.PNG

 

When I key-in text Sam in the textbox, I can see Sample1, Sample2 which is correct. However when I select Sample2 from the auto-complete results, it doesn't gets selected. If i click on Sample2, it should appear in the Event textbox.

 

Also, I notice the autocomplete results overlap other fields adjacent to it. Anyway we can avoid this ?


Hi @Kumar9024021 ,

I'm not sure how you set up the rest of your autocomplete feature. What OnSelect actions have you set up? Where are they located and what do those formulas look like?

 

Can you clarify what you mean by 'autocomplete results overlap other fields'?

Kumar9024021
Level: Powered On

Re: Autocomplete textbox doesn't work

Hi @Mr-Dang-MSFT ,

 

The Gallery OnSelect formula is

UpdateContext({showgalleryflag:false,Event:ThisItem.Event});

 

Scr2.PNG

 

 

Dual Super User
Dual Super User

Re: Autocomplete textbox doesn't work

Hi @Kumar9024021 

 

Can you try to update the configuration to:

Gallery OnSelect -> UpdateContext({showgalleryflag:false,Event:ThisItem.Event});Reset(DataCardValue5)

Also, in the Default property of the DataCardValue5, use the Event variable.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Kumar9024021
Level: Powered On

Re: Autocomplete textbox doesn't work

Hi @yashag2255 ,

 

Thanks for the response. When I tried to update the Gallery configuration, I get below error on the Reset(DataCardValue5)

 

Error.PNG

 

Any advice would be helpful. Thanks.

Dual Super User
Dual Super User

Re: Autocomplete textbox doesn't work

Hey @Kumar9024021 

 

To resolve this error, you can create a variable to reset the property as:

Gallery-> OnSelect -> UpdateContext({showgalleryflag:false,Event:ThisItem.Event});Set(ResetVar,true);Set(ResetVar,false)

 

DataCardValue5 -> Reset -> ResetVar

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Kumar9024021
Level: Powered On

Re: Autocomplete textbox doesn't work

Hi @yashag2255 ,

 

I added the above code and noticed that the code works fine in Preview without any issues.

 

However, when I save and publish the app, the selected autocomplete results gets reset to blank and the textbox shows blank.

 

I refreshed the browsing history, cache but still its the same. 

 

Dual Super User
Dual Super User

Re: Autocomplete textbox doesn't work

Hi @Kumar9024021 

 

Can you please confirm that the "Default" property of the textbox is set to Event variable?

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,842)