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

Required field not producing an error when left blank

I have a Powerapp form tied to a sharepoint list with a required field called Services.   The datacard receives its data from a choice list item which I deleted and instead created checkboxes.  The card has the following update formula to track the selected choices to submit back to the Sharepoint list item Services.  However, this required field does not generate an error when none of the checkboxes are selected.  I feel the following "Update" formula may be the cause of the problem as I'm not too familiar with all the functions yet

 

ForAll(
Split(Concatenate(
If(chkAccounting.Value, chkAccounting.Text & ",", ""),
If(chkAudit.Value, chkAudit.Text & ",", ""),
If(chkConsulting.Value, chkConsulting.Text & ",", ""),
If(chkCompil.Value, chkCompil.Text & ",", ""),
If(chkIsIt.Value, chkIsIt.Text & ",", ""),
If(chkLit.Value, chkLit.Text & ",", ""),
If(chkRev.Value, chkRev.Text & ",", ""),
If(chkTax.Value, chkTax.Text, "")
),
","
),
{Value: Result}
)

 

Any help is greatly appreciated.  Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Required field not producing an error when left blank

Hi @mjgenesis 

 

Can you share more details on the type of column that you are trying to patch value in?
 
If this is a choice type column, you can use the below expression:
 
Filter(Choices(SPListName.Services), Value in Split(Concatenate(
If(chkAccounting.Value, chkAccounting.Text & ",", ""),
If(chkAudit.Value, chkAudit.Text & ",", ""),
If(chkConsulting.Value, chkConsulting.Text & ",", ""),
If(chkCompil.Value, chkCompil.Text & ",", ""),
If(chkIsIt.Value, chkIsIt.Text & ",", ""),
If(chkLit.Value, chkLit.Text & ",", ""),
If(chkRev.Value, chkRev.Text & ",", ""),
If(chkTax.Value, chkTax.Text, "")
),
","
))
 
Here, please replace the highlighted part with the correct name of SP List and column Name. I carried out a test on my side and this works as expected.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
4 REPLIES 4
Super User
Super User

Re: Required field not producing an error when left blank

Hi @mjgenesis 

 

Can you share more details on the type of column that you are trying to patch value in?
 
If this is a choice type column, you can use the below expression:
 
Filter(Choices(SPListName.Services), Value in Split(Concatenate(
If(chkAccounting.Value, chkAccounting.Text & ",", ""),
If(chkAudit.Value, chkAudit.Text & ",", ""),
If(chkConsulting.Value, chkConsulting.Text & ",", ""),
If(chkCompil.Value, chkCompil.Text & ",", ""),
If(chkIsIt.Value, chkIsIt.Text & ",", ""),
If(chkLit.Value, chkLit.Text & ",", ""),
If(chkRev.Value, chkRev.Text & ",", ""),
If(chkTax.Value, chkTax.Text, "")
),
","
))
 
Here, please replace the highlighted part with the correct name of SP List and column Name. I carried out a test on my side and this works as expected.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
mjgenesis
Level: Powered On

Re: Required field not producing an error when left blank

I believe I did identify the field as a "choice" field, so you were correct in your assumption.

 

This formula works as now I see the error, but the problem it creates (and not sure if this is a function of the formula or my setup) is that if anyone goes back in to edit/view the record the record the radio button doesn't retain the option that was selected prompting the user to select it again. 

 

How can I keep the appropriate radio button marked based on what the original requestor selected?

 

Thanks

Super User
Super User

Re: Required field not producing an error when left blank

Hi @mjgenesis 

 

Is this a radio button or a checkbox control, please confirm.
 
If you are looking for filling the checkbox with the default selections, you may went to edit the "Default" property as:
If(chkAccounting.Text in ThisItem.Services.Value,true,false)
This needs to be used on all the checkboxes. Services is the name of column and chkAccounting is the name of control.
 
If this is a radio button, this only let the user select one value, so make sure that the choice field doesnot allow multiple selection and even if it does and it just have one item selected, you can use the expression on Default property:
First(ThisItem.Services.Value).Value
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
mjgenesis
Level: Powered On

Re: Required field not producing an error when left blank

The control is a radio button control and the column in the Sharepoint is a "Choice", but multiple selections are not enabled/allowed.  However, after I applied the default formula I'm still not seeing the radio option marked with the original selection when I edit the item.  Any other ideas?  thanks for your help.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 242 members 5,169 guests
Please welcome our newest community members: