cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Powertron
Advocate I
Advocate I

Status Field not populating on Form Load

Hi all,

 

I have a Powerapps form with a "Status" field, this field has 5 values as linked from a Sharepoint choice field in a list which is linked to the form.  If I set the field to Editable I can correctly manually select all the choices, so I know the linkage is working.  I have the following code set in "Default" status of the field : 

 

 

If(
   Request.Mode = FormMode.New, 
   {Value: New},
   {Value: ThisItem.Status}
)

 

Despite this on loading the app the field remains empty.  

 

Any ideas what I'm doing wrong?  Quite new to PowerApps so likely something stupid I've missed.

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Powertron ,

If that is a Combo Box, your code needs to be in the DefaultSelectedItems, not the Default.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

5 REPLIES 5
AmDev
Super User
Super User

Hi @Powertron 

 

Assuming this is the 'Default' property in the datacard for your status field and your Form is called 'Request' - Also, for a new form, you want the Status to = "New".

 

If my understanding is correct, please try with the following tweak to add " around your New text. This ensures Power Apps reads it as text.

 

If(
   Request.Mode = FormMode.New, 
   {Value: "New"},
   {Value: ThisItem.Status}
)

 

Hope this helps

 

WarrenBelz
Super User
Super User

Hi @Powertron ,

If that is a Combo Box, your code needs to be in the DefaultSelectedItems, not the Default.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Hi,

 

I have changed the code to what you've said, however the box remains the same, i.e no value on load.

 

The code indicates there are no issues but when opening the form in newform mode the box has no value.

 

Thanks,

 

Fraser

Hi @Powertron ,

Assuming

  • Request is the name of the Form this Combo Box is contained in
  • The Item of this Combo Box would be Choices(YourListName.Status)

That code looks correct to me. Are either of these untrue ?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Hi @WarrenBelz ,

 

I don't see any option for DefaultSelectedItems in my combobox Advanced properties, however on some digging around the place I found this under the DataCardValue value section of this drop down box.  With the change from @AmDev above applied to the code in this box this is now working fine.  Thanks both.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,441)