Cascading Two dropdowns in PowerApps based on Dynamics 365 CRM optionset field

By | October 23, 2019

Introduction

In today’s blog we will explore how to do cascading of two dropdowns in PowerApps based on Dynamics 365 CRM optionset field.

To achieve this, first we need to create two optionset fields in Dynamics 365 CRM e.g. Mobile Company (Parent optionset) and Mobile Handset (Child optionset) in the Dynamics 365 CRM Account Entity.

Now, as given below, create the collection in PowerApps on load of the Account edit form code.

ClearCollect(productinfo,
{Company:"Nokia",Product:"Nokia 6.1"},
{Company:"Nokia",Product:"Nokia 7.1"},
{Company:"Nokia",Product:"Nokia 8.1"},
{Company:"Apple",Product:"Iphone 7"},
{Company:"Apple",Product:"Iphone X"},{Company:"Apple",Product:"Iphone XS"});

Now on ‘Edit form’ I have shown both dropdowns. On company dropdown properties click on the dropdown, go to Advanced-> Data ->Items. Enter the code given below:

Filter(productinfo,Product=DataCardValue11.Selected.Value)

And set Company coming from the collection which we have created in the Value as shown in the below screenshot:

Cascading Two dropdowns in PowerApps

Now in the mobile PowerApps you will see that on selecting the Product ‘Nokia 6.1’ Company is set as ‘Nokia’ and on selecting Product ‘iPhone XS’ Company is set as ‘Apple’ as shown in the below screenshot:

Cascading Two dropdowns in PowerApps

Cascading Two dropdowns in PowerApps

Conclusion

Thus, as illustrated above, you can easily cascade two dropdowns in PowerApps based on Dynamics 365 CRM optionset field.