Data validation issue

I am trying to make a data validation on my form, I use the same as this Add Conditional Visibility & Data Validation

The issue that I am facing is that once I entered all the required fields I back and delete one field and the validation is not changing to the submit gray button

=NOT(OR(ISBLANK($[Field1]),ISBLANK($[Field2]),ISBLANK($[Field3]),ISBLANK($[Field4]))))

Hi @Gsanchezc :honeybee:

I tried this out and experienced what you did as well; I'll let the team know, so they can take a look.

For a solution now, you can have your formula check if the fields are empty with "" instead:
=NOT(OR($[Field1]="",$[Field2]="",$[Field3]="",$[Field4]=""))

With this formula in the visibility properties, the submit button hides as expected after I delete input from a field.

Hope that helps, and let us know if you bump into anything else! :slight_smile: :honey_pot:

1 Like

Thanks, this workaround works at my end too. Nevertheless providing the option of required fields in HoneyCode will be the ultimate solution for this use case, don't you agree?

I'm happy that formula works for you, @Gsanchezc! :slight_smile:

And good note, I can see how an easier option or way to make a field mandatory would be helpful. I'll pass this along to our team as improvement request. Let us know if you think of anything else that would make it easier for you to build in Honeycode. :honeybee: :honey_pot:

@Alyssa - What would formula above ^^^ look like if in addition to regular fields you had many checkboxes and at least one of the checkboxes needs to be =TRUE (Checked) ? I was hoping I could some how reference the whole block or segment rather than each check box.

Hi @MJ!

For this, I'd recommend creating a screen variable that validates if at least one of the checkboxes are selected. Then you would add this variable into the formula on the submit button.

To set this up, create a data cell and set it to variable. For the value, set it to check if any toggle has been selected with: =OR($[Toggle1]=TRUE, $[Toggle2]=TRUE, $[Toggle3]=TRUE)

Then for the visibility on your submit form, here's a formula that checks if each field is filled out and at least one checkbox is selected: =AND($[Field1]<>"",$[Field2]<>"",$[Field3]<>"",$[Field4]<>"", $[CheckboxesNotBlank]=TRUE)

Let us know if that helps and if you have any other questions. :slight_smile: :honey_pot: :honeybee:

@Alyssa Sorry for delay.. Appreciate the the Help! . I'm not getting the desired effect The grayed out button seems to stay grayed out correctly but once all the requirements are met both the gray submit button and the Blue (the actual button) Submit Button disappears. I have checked / unchecked ... the logic in the formula seems correct ?

Blue:
=NOT(OR($[Incident_Date_content]="",$[Incident_Time_content]="",$[Incident_Type_content]="",$[First_Name_content]="",$[Last_Name_content]="",$[Employee_Location_content]="",$[Work_Type_content]="",$[Location_Category_content]="",$[Location_Description_content]="",$[Incident_Description_content]="",$[Radio]="",$[InjuryNotBlank]=TRUE,$[BodypartNotBlank]=TRUE))

Gray -
=(OR($[Incident_Date_content]="",$[Incident_Time_content]="",$[Incident_Type_content]="",$[First_Name_content]="",$[Last_Name_content]="",$[Employee_Location_content]="",$[Work_Type_content]="",$[Location_Category_content]="",$[Location_Description_content]="",$[Incident_Description_content]="",$[Radio]="",$[InjuryNotBlank]=FALSE,$[BodypartNotBlank]=FALSE))

InjuryNotBlank Variable -

=OR($[Sprain]=TRUE,$[Laceration]=TRUE,$[Contusion]=TRUE,$[Fracture]=TRUE,$[Dislocation]=TRUE,$[Burn]=TRUE,$[Concussion]=TRUE,$[Amputation]=TRUE,$[Puncture]=TRUE,$[StingBite]=TRUE,$[Abrasion]=TRUE,$[Blister]=TRUE,$[ForeignBody]=TRUE,$[Muscle]=TRUE,$[Tinnitus]=TRUE,$[Disease]=TRUE,$[Infection]=TRUE)

BodypartNotBlank Variable -

=OR($[Head]=TRUE,$[Nose]=TRUE,$[Eyes]=TRUE,$[Ears]=TRUE,$[Mouth]=TRUE,$[Neck]=TRUE,$[Chest]=TRUE,$[Abdomen]=TRUE,$[Hips]=TRUE,$[Groin]=TRUE,$[Shoulder]=TRUE,$[UpperArm]=TRUE,$[Elbow]=TRUE,$[LowerArm]=TRUE,$[Wrist]=TRUE,$[Hand]=TRUE,$[Finger]=TRUE,$[Spine]=TRUE,$[UpperBack]=TRUE,$[MidBack]=TRUE,$[LowerBack]=TRUE,$[Buttocks]=TRUE,$[UpperLeg]=TRUE,$[Knee]=TRUE,$[LowerLeg]=TRUE,$[Ankle]=TRUE,$[Foot]=TRUE,$[Toes]=TRUE)

What is even more weird is when both variables are FALSE (meaning no boxes checked for either variable) both buttons show up

Something else to report is that the Radio Button seems when yes or no is selected with all other fields filled out makes both submit buttons disappear. ?

Hi MJ,

Thanks for reaching out. I tried to simulate the scenario using sample datacells, checkboxs, radiobuttons and buttons. Below is the screenshot. I have set two variables InjuryNotBlank and BodyPartNotBlank to toggle the checkbox selection.

Below are the queries:

InjuryNotBlank variable -
IF(OR($[Head]=TRUE,$[Neck]=TRUE,$[Arms]=TRUE),TRUE,FALSE)

BodyPartNotBlank variable -
IF(OR($[Burn]=TRUE,$[Sprain]=TRUE,$[Fracture]=TRUE),TRUE,FALSE)

Blue -
IF(OR($[fname]="",$[lname]="",$[InjuryNotBlank]=FALSE,$[BodyPartNotBlank]=FALSE,$[Radio]=""),FALSE,TRUE)

Gray -
IF(OR($[fname]="",$[lname]="",$[InjuryNotBlank]=FALSE,$[BodyPartNotBlank]=FALSE,$[Radio]=""),TRUE,FALSE)

If all the sections are filled and checked, it will toggle grey button to blue as below:

If any of the section on the screen is blank, it will toggle the button back to grey:

I hope above queries will help creating validation on the screen. Feel free to reach out to us if you see any more issues.

2 Likes

@Pankaj @Alyssa Thank you for the help! The IF Statement seems to do the trick. This lengthy , redundant experiment has helped me understand the syntax and Honeycode in general a little better.

4 Likes

Hi @MJ,

We are glad this helps :slight_smile: .
Feel free to reach out to us if you have any more questions.