cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

How do i get PowerApps Forms to populate the default value from a sharepoint field?

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

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" }

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

7 REPLIES 7
Highlighted
Super User II
Super User II

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.

 

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted

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

Highlighted

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" }

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Hi Jeff, 

 

Apologies for taking so long to confirm but this fixed it perfectly. Thanks very much for your help

 

Kind regards

Alex

Highlighted

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.

Highlighted

Never mind. I figured it out. You need to put it in the Default field for the data card, not the dropdown box. Smiley Frustrated

 

ID1OT.png

Highlighted
Regular Visitor

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.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,489)