Hi Folks,
I'm tring to build a SharePoint List form in PowerApps and am flumoxed by a really basic problem.
The issue is that when you include a field that corresponds to a sharepoint choice column.. it does not pre-populate with the default value i have defined in the SharePoint list.
The specific use case is that i want a list items 'status' to equals 'logged' when an new item is created. However any person creating a new item has the option of picking 5 or 6 different statuses which would derail an associated workflow.
Can anyone help me in either..
A) Having the form pre-populate the field as per the 'default' value i have defined in the SP list
or
B) Provide me direction on how i might manually define the populated value within the PowerApps form itself (I could then make it a view only field so the person wouldnt be able to change it)
Kind regards
Alex
Solved! Go to Solution.
If the only form used for new items is "FormNew" then replace "EditForm1" with "FormNew". In theory if the "FormNew" is only used for new items then you could just use the formula below because there is no need to test for edit mode.
{ Value: "logged" }
Default values don't carry over from SharePoint to the PowerApps form. You will need to set the default value in the PowerApps form. You mentioned that in your case you are using a choice column, so this will be easy.
In the DefaultSelectedItems property of the data card value control for your choice field use the following formula:
If(EditForm1.Mode = FormMode.New, { Value: "logged" }, Parent.Default)
This assumes that "logged" is a value in your choice list and you want to default to this value when the form is new.
Hi Jeff,
Thanks for this. It looks like just the ticket no pun intended.
I'm not going to get an opportunity to try this until thursday when i get access to a computer that will run powerapps. A quick followup question in advance of that..
My form app has two "pages" - 'FormNew' for when a ticket is being created, and 'FormEdit' for when it's being edited.
Should i replace 'EditForm1' as follows?
If(FormNew.Mode = FormMode.New, { Value: "logged" }, Parent.Default)
Kind regards
Alex
If the only form used for new items is "FormNew" then replace "EditForm1" with "FormNew". In theory if the "FormNew" is only used for new items then you could just use the formula below because there is no need to test for edit mode.
{ Value: "logged" }
Hi Jeff,
Apologies for taking so long to confirm but this fixed it perfectly. Thanks very much for your help
Kind regards
Alex
I am having nearly the exact same problem, except this solution isn't working for me. I have a form, called frmNewAppResearchAssistant. Its default mode is set to New. It has a field, called ApplicationType. I set the default for ApplicationType to the following, which is a choice option for that field.
{ Value: "Research Assistant" }
It does absolutely nothing.
Never mind. I figured it out. You need to put it in the Default field for the data card, not the dropdown box.
You can do your own. By using IsNumeric to determine a new record using the list's ID column. Then I set defaults when the value is false. If true then you use the field's current value for the current item.
Set(notNew, IsNumeric(DataCardValue1.Text))
You just need to do this in the OnView event of your list. Then the value works on all screens.
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
268 | |
225 | |
76 | |
38 | |
38 |
User | Count |
---|---|
339 | |
224 | |
121 | |
71 | |
57 |