cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Brendenward
Frequent Visitor

Hidden fields changes default field to blank

Hi, I've got a power apps form that I want to hide 2 fields when the form loads. It's based on a choice field that defaults to New Request. I've done a rule that says when Request status is equal to New Request it hides the 2 fields and it works. But my problem is the form loads and the status field comes in as blank even though its set to New Request in the list settings so no idea why this is doing this? Any ideas would be appreciated even if i can get the form on load to set the status field to New Request would be an answer. I've attached a screen dump of the rule I set

 

Any help be appreciated

Thanks

Brenden

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Thorpe
Super User
Super User

Since the field is on the form (just not visible) the blank value gets submitted. The easy fix is to add a default value to the hidden field. I had a similar issue with a status choice field and here is the formula I used in the DefaultSelectedItems property of the combo box.

 

If(SharePointForm1.Mode = FormMode.New, { Value: "New Request" }, Parent.Default)

 

Your data source and field type might be different, so you may need to tweak the formula.



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

2 REPLIES 2
Jeff_Thorpe
Super User
Super User

Since the field is on the form (just not visible) the blank value gets submitted. The easy fix is to add a default value to the hidden field. I had a similar issue with a status choice field and here is the formula I used in the DefaultSelectedItems property of the combo box.

 

If(SharePointForm1.Mode = FormMode.New, { Value: "New Request" }, Parent.Default)

 

Your data source and field type might be different, so you may need to tweak the formula.



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

Jeff you are an absolutely star thank you so much for you help really appreciated.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (85,789)