cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlexCretney
Level: Powered On

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
Super User
Super User

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

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

6 REPLIES 6
Super User
Super User

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

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.
AlexCretney
Level: Powered On

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

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

Super User
Super User

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

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

AlexCretney
Level: Powered On

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

Hi Jeff, 

 

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

 

Kind regards

Alex

Brian-Hamilton
Level: Powered On

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

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.

Brian-Hamilton
Level: Powered On

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

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 121 members 5,384 guests
Please welcome our newest community members: