cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kumar9024021
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

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
Mr-Dang-MSFT
Power Apps
Power Apps

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

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 ?


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

Hi @Mr-Dang-MSFT ,

 

The Gallery OnSelect formula is

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

 

Scr2.PNG

 

 

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!

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.

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!

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. 

 

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,155)