cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

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
Highlighted
Dual Super User III
Dual Super User III

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
Highlighted
Power Apps
Power Apps

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

Highlighted
Helper V
Helper V

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 ?

Highlighted
Power Apps
Power Apps

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'?

Highlighted
Helper V
Helper V

Re: Autocomplete textbox doesn't work

Hi @Mr-Dang-MSFT ,

 

The Gallery OnSelect formula is

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

 

Scr2.PNG

 

 

Highlighted
Dual Super User III
Dual Super User III

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!

Highlighted
Helper V
Helper V

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.

Highlighted
Dual Super User III
Dual Super User III

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!

Highlighted
Helper V
Helper V

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. 

 

Highlighted
Dual Super User III
Dual Super User III

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,998)