cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MikeAnderson
Level 8

Cascading Combobox show loading message

Hello,

 

I'm trying to figure how how to inform the user while a combobox is loading.  I have 2 cascading combo boxes.  The first combobox is loaded with values on App start.  The user makes a selection in combobox 1, and this selection is used to filter the results for combobox 2.  This is a query that runs over the gateway and can take a second or two to load, so during this time, I'd like to display a "Please wait - loading . . " message in the 2nd combobox. 

What I have so far is in the 1st combobox OnSelect property I set a variable to as follows:
Set(IsLoading, True);

Then in the 2nd combobox InputTextPlaceholder method, I check this variable and display the message a message:
If(IsLoading, " Please wait", "Select choice");

Also, in the 2nd combobox Items property, I have a filter:
Filter ('datasource', ChoiceID = Combobox1.Selected.Choice).ID

 

What I can't figure out is once the Items have loaded in Combobox 2, how do I change the variable back to false?  I get an error if I place this in the ComboBox2.Items property:
Filter ('datasource', ChoiceID = Combobox1.Selected.Choice).ID;
Set(IsLoading, false);

"Behvaior function in a non-behavior property".

 

I can't seem to figure out a way to accomplish what I'd like to do. Any thoughts?

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Cascading Combobox show loading message

Hey @MikeAnderson 

 

You are getting this error because the behaviour functions are not allowed in the "Items" property.
You cannot directly set this variable to false. As a workaround for this, you can create a local collection when the combobox1 control is selected and same collection can be used in items of combobox2 and the Placeholder text can be set based on the rows count in Collection.
 
Combobox1: OnChange -> Clear(MyCombobox2Coll);Collect(MyCombobox2Coll,Filter ('datasource', ChoiceID = Combobox1.Selected.Choice).ID)
 
Combobox2: Items -> MyCombobox2Coll
 InputTextPlaceholder -> If(CountRows(MyCombobox2Coll) = 0, " Please wait", "Select choice")
 
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

2 REPLIES 2
Dual Super User
Dual Super User

Re: Cascading Combobox show loading message

Hey @MikeAnderson 

 

You are getting this error because the behaviour functions are not allowed in the "Items" property.
You cannot directly set this variable to false. As a workaround for this, you can create a local collection when the combobox1 control is selected and same collection can be used in items of combobox2 and the Placeholder text can be set based on the rows count in Collection.
 
Combobox1: OnChange -> Clear(MyCombobox2Coll);Collect(MyCombobox2Coll,Filter ('datasource', ChoiceID = Combobox1.Selected.Choice).ID)
 
Combobox2: Items -> MyCombobox2Coll
 InputTextPlaceholder -> If(CountRows(MyCombobox2Coll) = 0, " Please wait", "Select choice")
 
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

MikeAnderson
Level 8

Re: Cascading Combobox show loading message

Thanks Yashag2255,

 

I understood why I couldn't set the variable, just couldn't construct another way of achieving the same objective.  Your method is perfect!

 

 

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 (4,350)