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

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
yashag2255
Dual Super User II
Dual Super User II

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!

View solution in original post

4 REPLIES 4
yashag2255
Dual Super User II
Dual Super User II

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!

View solution in original post

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

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!

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (811)