cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nagestiada
Post Partisan
Post Partisan

Validation on dropdown and textbox

So I have multiple dropdown and text input with an validation label on each. 

Here is a sample code of visible on validation label.

TextBox: If(DataCardValue17.Text="",true,false)

Dropdown: If(IsBlank(DataCardValue21.Selected.Value),true,false)

What I want to do is for all my validation label to appear once I click on the button submit.

13 REPLIES 13

@nagestiada , 

Try either making the Default of the Text boxes "" (empty string) or use this code.

 

If(
   IsBlank(DataCardValue17.Text) || 
   IsBlank(DataCardValue16.Selected.Value) || 
   IsBlank(DataCardValue21.Selected.Value) || 
   (   DataCardValue16.Selected.Value="Other" && 
       IsBlank(DataCardValue18.Text)
   )|| 
   (
      DataCardValue21.Selected.Value="Yes" && 
      IsBlank(DataCardValue6.Text) && 
      IsBlank(DataCardValue7.Text)
   ),
   UpdateContext({vViewLabel:true}),
   UpdateContext({Popup:true})
)

 

Also put a table on the screen with vViewLabel and see if it turns to true when it should.

 

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.

 

 

If(
   IsBlank(DataCardValue17.Text) || 
   IsBlank(DataCardValue16.Selected.Value) || 
   IsBlank(DataCardValue21.Selected.Value) || 
   (   DataCardValue16.Selected.Value="Other" && 
       IsBlank(DataCardValue18.Text)
   )|| 
   (
      DataCardValue21.Selected.Value="Yes" && 
      IsBlank(DataCardValue6.Text) && 
      IsBlank(DataCardValue7.Text)
   ),
   UpdateContext({vViewLabel:true}),
   UpdateContext({Popup:true})
)

 

 

 

 

this works but when I clicked yes 

DataCardValue21.Selected.Value="Yes" && IsBlank(DataCardValue6.Text) && IsBlank(DataCardValue7.Text)

 

 the and on 6 and 7 does not work, one blank and one not blank still goes through submit. 

Hi @nagestiada ,

This is not a coding issue, but an exercise on logic and and/or brackets - I do not know what you are trying achieve.

Can you please put in plain words the If / and /or you are trying to get?

Hi @nagestiada ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,337)