Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Status Field not populating on Form Load

Posted on by

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.

 

  • Powertron Profile Picture
    Powertron on at
    Re: Status Field not populating on Form Load

    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.

  • WarrenBelz Profile Picture
    WarrenBelz 143,532 on at
    Re: Status Field not populating on Form Load

    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

  • Powertron Profile Picture
    Powertron on at
    Re: Status Field not populating on Form Load

    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

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 143,532 on at
    Re: Status Field not populating on Form Load

    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

  • AmDev Profile Picture
    AmDev 3,006 on at
    Re: Status Field not populating on Form Load

    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

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,532

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,050

Leaderboard