cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Is there a way to make sure that the user submit atleast one multi-line text field out of 5

I have customized my SharePoint online Create and Edit using powerapp, and inside my create form i have 5 multi-line text fields, so can i add a validation to force the user to enter data inside atleast one of the 5 multi-line of text fields?

7 REPLIES 7
Highlighted
Community Champion
Community Champion

Re: Is there a way to make sure that the user submit atleast one multi-line text field out of 5

Hi @johnjohn123 ,

Form your post are you wanting the user to enter at least one character in at least one of these fields. If so, put this on the save button

If(
   isBlank(YourField1) &&
   isBlank(YourField2) &&
   isBlank(YourField3) &&
   isBlank(YourField4) &&
   isBlank(YourField5),
   Notify(
      "At least one field need to be completed!",
      NotificationType.Error
   ),
   <whatever the save code is now>
)
          


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. 

Highlighted
Resident Rockstar
Resident Rockstar

Re: Is there a way to make sure that the user submit atleast one multi-line text field out of 5

@johnjohn123 

Forms have a validation property you can utilise for this but I like to Disable/Enable buttons for this type of thing. Something like this on your Submit button would work

 

SubmitBtn.DisplayMode = If (IsBlank( Concatenate( MultiLine1Text.Text, MultiLine2Text.Text, ... )), DisplayMode.Disabled, DisplayMode.Edit)

 

This wouldn't stop them putting a single character in one field and being able to submit that but that's a different problem. You could also have a label that explains your expectations so the user understands why they cannot submit.

Highlighted
Community Champion
Community Champion

Re: Is there a way to make sure that the user submit atleast one multi-line text field out of 5

Hi @johnjohn123 ,

My colleague @Eelman and I have given you two different approaches. We can both solve this for you. Just tag whichever one you want to go with in your response.

Highlighted
Helper II
Helper II

Re: Is there a way to make sure that the user submit atleast one multi-line text field out of 5

@WarrenBelz Can you please mention where i need to add this code? inside the save button?

Highlighted
Community Champion
Community Champion

Re: Is there a way to make sure that the user submit atleast one multi-line text field out of 5

@johnjohn123 ,

Yes, and put the current save code where I have put the <> brackets (without the brackets of course).

Incidentally you can get quite specific with this including making users put at least a certain number of characters using the Len(YourFieldName)<xx argument.

 

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.

Highlighted
Helper II
Helper II

Re: Is there a way to make sure that the user submit atleast one multi-line text field out of 5

sorry i am somehow new to power app , now the defualt power app form does not have a Save button, so how i can add code to it?

Highlighted
Community Champion
Community Champion

Re: Is there a way to make sure that the user submit atleast one multi-line text field out of 5

OK @johnjohn123 ,

The standard template item screen first gives you this for viewing

Standard1.png

 

 

then this for editing and saving

Standard2.png

So the code in the "Tick" above is (you will have to add your card value numbers, unless you have renamed then, then add the actual names you have used).

If(
   isBlank(DataCardValuexx) &&
   isBlank(DataCardValuexx) &&
   isBlank(DataCardValuexx) &&
   isBlank(DataCardValuexx) &&
   isBlank(DataCardValuexx),
   Notify(
      "At least one field need to be completed!",
      NotificationType.Error
   ),
   SubmitForm(EditForm1)
)

 

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.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (11,943)