I'm currently trying to simply set the Default value of a Dropdown in an Edit Form (Form is opened and the Dropdown should have a pre-selection). Even though I did extensive research I couldn't find a solution for a Sharepoint choice field (as I don't know how to find the ID's of those choices and how to reference it?
I have the DropDown with the Selections from Sharepoint ("Inland", "Ausland") and would like to be the Default for a blank form to be "Inland".
Thank you so much for your help.
Solved! Go to Solution.
I'd just want to avoid my dropdown-based form to be empty, and left without explanation. Right now it looks like that - all the fields are empty:
Default value is defined for every item in Sharepoint, and I'd just expect PA to preload and preset my preffered value
It sounds relatively easy to do, but the amount of hacks to get this done is terrifying. Or am I missing something obvious here?
Just to restate the steps I took:
1) Hardcoding value doesn't work, because data card expects a Record but is given a text
2) Records are not being preloaded until someone presses "arrow down", so I don't have anything to select to.
3) Tried a variety of different formulas but I just didnt find one that works.
I'm kind of green to the whole PowerApps thing, I love the idea but every attempt I make is a bit in the dark
Thanks for any help in advance on that
I really tried...I went back to see what you were doing with SharePoint and made a test form etc.. Actually it's a pretty neat feature if you're just working with SharePoint lists. Unfortunately what I tried doesn't currently work, but you might keep it in your back pocket in case they ever fix it. It's also useful if you ever need to use the 'Patch' function.
See the 'Defaults' function for PowerApps:
What I tried to do was set 'Default' for the dropdown to 'Defaults(spList).choice'. The way the 'Defaults' function works is it asks the data source for "default" values for each column/field and creates a record of those values that you can look at. Unfortunately SharePoint does not currently return this information...per the link I provided:
"Data sources vary in how much default information they provide, including not providing any at all. When you work with a collection or another data source that doesn't support default values, the Defaults function will return an empty record."
Ohh... Hold on... I thought we are talking about Default property of dropdown and not Defaults of Patch function. So what exactly are you trying to do?.. Sorry if I get a bit out of context
@SiennaNo you were good. I was hoping Defaults would return the values @AlexPaw had set via SharePoint. The purpose of Defaults appears to be to ask the datasource to provide the "default" values for each field/column and store it in a record. For SharePoint and the SQL server I tested, it provided a full record (so that you have all neccessary columns/fields), but left each column/field completely blank. I suppose some datasources will actually return the values but so far no luck on what I tried. The fact SharePoint doesn't return the default values for the choices is probably why PowerApps can't populate it in the first place. Shame it doesn't work out of the box this way.
This is just to share that the formula below for the DataCard Default works for me:
Remember to replace 'SPListName' and 'SPFieldName' with the actual SP List name and Field name, and "SpecificValue" with the choice value you would like to set as default.
The below formula worked with setting up on DefaultSelectedItems.
Thanks and Regards,
Keep up to date with current events and community announcements in the Power Apps community.
Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.
Check out the latest Community Blog from the community!