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

offline cascading dropdown

Hello,

 

I am looking to implement cascading dropdowns in a form, BUT OFFLINE.

 

it means that my dropdowns to refer to a SP list, or a file. I just hard code the different entry possibilities in the items property of the dropdown.

 

I would like dropdown 2 items to depend on dropdown1 items selected.

 

I tried to do a basic if statement on the items property of dropdown2  but it dosn't work.

 

Does anyone have any idea how to do that.

 

Many thanks in adavance

3 REPLIES 3
PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: offline cascading dropdown

Hi @blue_lotus,

It sounds like you want your cascading drop down menus to hook up to data offline.

 

Some options:

  • Hard code it with a static Table()--sounds like this is what you're already doing.
  • Connect a static table from Excel: View > Data sources > Import from Excel
  • Collect the options you want locally.

 

If your options do not change or change often, the best option is the second.

 

If the cascading dropdowns would change, then you'll want the third option. Here's an example:

 

// Load any cached data. Suppress any errors.
LoadData(localcollection1, "localcollection1", false);
LoadData(localcollection2, "localcollection2", false);

// If there was not data cached, attempt to do it now. If(IsEmpty(localcollection1), // Collect the items from a SharePoint list. ClearCollect(localCollection1, SharePointList1); // Save the table to the local storage. SaveData("localcollection1", localcollection1) ); // Repeat the same for other tables. If(IsEmpty(localcollection2), ClearCollect(localCollection2, SharePointList2); SaveData("localcollection2", localcollection2) );

 

 

Now that the data is local, you can make localcollection2 dependent on localcollection1 in the Items property of Dropdown2:

 

Filter(localcollection2,column=Dropdown1.Selected.column)

Here Dropdown1 would be tied to localcollection1. Whatever is selected in Dropdown1 would filter Dropdown2 which is connected to localcollection2.

 

There's lots of threads on here for these scenarios. You can do a search for SaveData and LoadData.

TopShelf-MSFT
Level 10

Re: offline cascading dropdown

Thanks for posting in the community @blue_lotus - can you review the above reply and update the thread if it was helpful?

 

Thank you,

 

@TopShelf-MSFT 

eka
Level: Powered On

Re: offline cascading dropdown

Please does this apply to Azure Sql, I am trying to implement it but it not working for me;

LoadData(localCollection1, "localcollection1", false);
If(IsEmpty(localCollection1),
ClearCollect(localCollection1, '[dbo].[tblUser]');


SaveData("localcollection1", localCollection1)
)

thanks in advance for your massive support to the community.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,922)