cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KathrynHughes
Helper I
Helper I

Displaying a label as part of an IF function

I have this line of code:

 

If the collection is empty then the form submits - this works.

If the collection is not empty I would like a label to display - this is where I'm stuck.

 

This is the line of code I have(where Failed is the name of my label):

If(IsEmpty(checking2),SubmitForm(Form2),Failed.Visible)

 

Any suggestions to where I'm going wrong or another way of doing things would be great.

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @KathrynHughes 

The way to do this is to set the Visible property of your Failed label to this:

If(IsEmpty(checking2), 
false,
true
)

You'll need to go the advanced tab of the properties pane to be able to enter the formula.

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hello,

 

You just don't give any value to your Failed.Visible property! 🙂

 

If(IsEmpty(checking2),SubmitForm(Form2),Failed.Visible = true)

Does it help you ?

 

Best regards,

 

Louis

 

timl
Super User
Super User

Hi @KathrynHughes 

The way to do this is to set the Visible property of your Failed label to this:

If(IsEmpty(checking2), 
false,
true
)

You'll need to go the advanced tab of the properties pane to be able to enter the formula.

 

It worked when I changed the visible property of the label and not from adding to the IF function.

 

Thanks for getting back to me.

Glad that solved your problem @KathrynHughes 

Just as a sidenote, it isn't possible in PowerApps to make assignments like this:

 

Failed.Visible = true

So in any scenario where we want to do this, the answer is the apply the formula/condition against the property, just like you've done here.

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (4,665)