I have an edit screen with two dropdowns controls. The first dropdown is Client and the sceond is ClientProject. After choosing the client, the user can seleect the specific project for the client. The ClientProject dropdown is filtering it's list values based on the value of the Client dropdown.
When adding a new record, though, after I select a client, the Client Project dropdown always gets set to the first value on the list. I would preer that it would be left blank. Is this possible?
Solved! Go to Solution.
Ruth here is how you can recreate LookUp columns in SharePoint using PowerApps.This works across site collections also.
For setting the default blank value I usually create a - as the first item in my list of choices and use that as the default. Not perfect but better than nothing.
Are you configuring the two Dropdown controls on an Edit Form?
What functions are being used to the Dropdown controls?
Say you are configuring the two dropdown controls on an Edit form, so I created a SharePoint listC as my data source, then created an app based on this list automatically.
On the EditScreen, I customized the ClientName and ClientProject fields and added two dropdown controls to each of the two fields.
For ClientName, I set the Items property of the Dropdown control as ListC.Title
For ClientProject, I set the items property of the Dropdown control as Distinct(Filter(ListC,Title=Dropdown3.Selected.Value),OData__x0064_le0)
But it seems that we are not able to set the Default value of the Project field to Blank. When selecting an ClientName, the corresponding ClientProject would be shown. It seems that it cannot be Blank.
If I misunderstand you, please feel free correct me.
Good question @dfin, did you ever get it to work as wanted?
This is something I'm having some trouble to acomplish too, thus i'm trying to make this post become alive again.
I'd rather not make a "Blank" entry option, as this most likely would make my data having lower quality because people most certanly will end up submitting these blank values from time to time 😉
If someone know how to fix this i'd really like to hear about it.
All the best
Have you tried using a combo box instead of a drop down? The combo box doesn't select the first item as the default value.
Thanks for your reply @Jeff_Thorpe.
No I have not, I'm not even sure what an ComboBox is 🙂
But I was lucky to discover that if i wrote:
"Defaults('[MySharepointList]'.Blank())" into the field DefaultSelectedItems i get the desired result (I do get the yellow waring sign though).
I haven't test it out but it looks like the code example would make the field blank with an item is new and when you edit the item. Have you tested it out when editing an existing item?
Thanks for your input, and I'll kepp it in mind.
No i have not done that, but you might be right, although, the form I'm usig it for is creating new items only and I think there is no danger for anyone to edit an item because I resets all fields in the form when opening this screen using the "newform" action (or what i should call it 🙂 ). Unless I miss somethin obvious.
This is my first App so i beg your pardon if I seem a bit dense 🙂
There are several ways to tackle what you are talking about I think. If you like the idea of having blank by default but concerned with the data being saved as blank, there are ways to prevent that. An easy workaround, set the 'Visible' property of your submit form button to hide the button when the dropdown selection is 'blank'.
Perhaps the best solution for data integrity is to properly set up the data source validation and use the 'Validate' function of PowerApps to validate any records before attempting to save them, see here:
This would require the proper validation settings in the data source (i.e. the column set to not allow blanks, etc.). I'm vaguely familiar with SharePoint lists, but it seems you can set up validation on a column in a list, and even provide an error message that is shown to the user when data doesn't validate. Once it's set up in SharePoint, using 'Validate' function in PowerApps will check the form fields and provide messages to the user when something isn't right.
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.