cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NickMorrell
New Member

Clear blanks in a dropdown list, and auto-populate other fields

Hey everyone,
Very new to PowerApps. I have a dropdown list, and it shows values from a column that also contains some blank cells. How do I configure the list to only show the non-blank cells? And, how can I make it show a blank as the default selection rather than the first value in the column?

Next, I want the selection from the list to auto-populate some other text fields on the page. How can I make the fields fill with values corresponding to what is picked in the dropdown?

 

These fields I want filled come from a different table. The dropdown is the column "PYEmployeeCode" from the table RMEmployee; I need to autofill two fields with the corresponding values from the "Surname" and "Firstname" columns in the PYEmployee table. So, how can I make the connection between RMEmployee's "PYEmployeeCode" column and PYEmployee's "EmployeeCode" column? 

 

The attached image is a rough representation of the two tables. They're actually different Sheets in the same Excel workbook.

 

Thanks so much for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yuxima-msft
Community Support
Community Support

Hi @NickMorrell,

 

For your first question

Do you want to the dropdown’s first item blank and other items not blank from table’s value?

For your second question:

Do you want the field of Firstname and Surname are auto filled by the employeecode to be selected?

I think you can try following workaround.

I test as next:

 

DataSource(as screenshots show next)

20190211datasource.png

App Test :

For your first question:

Add one Button and rename Button_Collect,Button_Collect.OnSelect: ClearCollect(dropdownwithblank,{Name: Blank()});Collect(dropdownwithblank,Filter(Table3, !IsBlank(Name)).Name)

Dropdown_blankdropdown.Items: dropdownwithblank.Name

20190211apptest.png

For your second question?

Dropdown_Code.Items: RMEmployee.PYEmployeeCode

Label_Firstname.Text: LookUp(PYEmployee, EmployeeCode=Dropdown_Code.Selected.Value).Firstname

Label_Surname.Text.Text: LookUp(PYEmployee, EmployeeCode=Dropdown_Code.Selected.Value).Surname

 

Result Test(both question 1 and question2):

20190211clearcascadingdropdown.gif

 

Hope this can be helpful.

Best Regards.

Yumia

 

 

View solution in original post

2 REPLIES 2
v-yuxima-msft
Community Support
Community Support

Hi @NickMorrell,

 

For your first question

Do you want to the dropdown’s first item blank and other items not blank from table’s value?

For your second question:

Do you want the field of Firstname and Surname are auto filled by the employeecode to be selected?

I think you can try following workaround.

I test as next:

 

DataSource(as screenshots show next)

20190211datasource.png

App Test :

For your first question:

Add one Button and rename Button_Collect,Button_Collect.OnSelect: ClearCollect(dropdownwithblank,{Name: Blank()});Collect(dropdownwithblank,Filter(Table3, !IsBlank(Name)).Name)

Dropdown_blankdropdown.Items: dropdownwithblank.Name

20190211apptest.png

For your second question?

Dropdown_Code.Items: RMEmployee.PYEmployeeCode

Label_Firstname.Text: LookUp(PYEmployee, EmployeeCode=Dropdown_Code.Selected.Value).Firstname

Label_Surname.Text.Text: LookUp(PYEmployee, EmployeeCode=Dropdown_Code.Selected.Value).Surname

 

Result Test(both question 1 and question2):

20190211clearcascadingdropdown.gif

 

Hope this can be helpful.

Best Regards.

Yumia

 

 

View solution in original post

How can I do this with a Distinct?  This is my formula, but my dropdown is not showing anything.  Instead of a blank, I want it to say All as the default.

ClearCollect(collectAgency, {Result: "All"});
Collect(collectAgency, Filter(PIT, !IsBlank(CustomerAgency)).CustomerAgency);

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,787)