Overview

Pre-Requisites

(Please note, here I am not covering the cascading dropdown case)

Motivation

Here, our simple approach is when I change the Country dropdown, automatically State and Full address fields should be blank.

Let’s get started…

1. First we will need to turn on one feature. So, Click on File > Settings > Upcoming Features > Experimental Tab > Turn On Formula-level error management feature.

2. Now, back to our form, we will first unlock all the fields

3. Here, DataCardValue for the respective fields are as below. (We can also Rename and give a meaningful name. We will use as it is)

  1. Country = DataCardValue2
  2. State = DataCardValue3
  3. Full Address = DataCardValue4

4. In New form below formula will work when we change our Country and it will reset the values of State and Full address fields.

  1. Select the Country DataCard’s DataCardValue2 and go to OnChange property and write below formula:

OnChange = Reset(DataCardValue3); Reset(DataCardValue4);

5. For Edit Form above formula will not work. So, follow below workaround:

  1. Declare one global variable in OnEdit method of SharePointIntegration. In PowerApps New or Edit form it gives us edit mode as a OOTB form display mode. So, this variable will help us to determine that form is currently in Editmode or not.

OnEdit = Set(CurrFormMode,"EditMode");

6. Now, select the DataCardValue2 (Country) and go to the OnSelect property and write below formula. As I said, in Form Edit mode formula written in OnChange method will not work, So, we will call OnChange method through OnSelect method:

OnSelect = If(CurrFormMode = "EditMode", Set(ResetOnChange, true) );

7. Next, on the same DataCardValue2 (Country), go to the OnChange property and write below formula. Keep previous reset formula as it is.

OnChange = If(ResetOnChange, Set(ResetStateandAddress, true);, Set(ResetStateandAddress, false););

8. Next, we need to reset our State and Full Address fields. So, select the DataCardValue3 for States (Combobox) and go to the “DefaultSelectedItems” property and write below formula. This formula will check that someone has changed the Country dropdown or not. If ResetStateandAddress variable value is true. So, need to set value as blank otherwise keep default value.

DefaultSelectedItems = If(ResetStateandAddress, Blank(), Parent.Default)

9. Next, select the DataCardValue4 for Full Address (Single line of text) and go to the “Default” property and write the same above formula:

Default = If(ResetStateandAddress, Blank(), Parent.Default)

10. Now, Save and Publish the form to SharePoint.

11. Here, we have successfully resolved the PowerApps dropdown issue in Edit form.

Enjoy!