web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Autocomplete textbox d...
Power Apps
Unanswered

Autocomplete textbox doesn't work

(0) ShareShare
ReportReport
Posted on by 195

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.

 

 

Categories:
I have the same question (0)
  • Mr-Dang-MSFT Profile Picture
    on at

    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 Profile Picture
    195 on at

    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 ?

  • Mr-Dang-MSFT Profile Picture
    on at

    @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 Profile Picture
    195 on at

    Hi @Mr-Dang-MSFT ,

     

    The Gallery OnSelect formula is

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

     

    Scr2.PNG

     

     

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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 Profile Picture
    195 on at

    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.

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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 Profile Picture
    195 on at

    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. 

     

  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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!

  • Kumar9024021 Profile Picture
    195 on at

    Hi @yashag2255 ,

     

    Yes, default property is already set to Event variable.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard