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

If Statment using AND

What is the syntax for using And  in an if statment?

Need a button disabled if 2 condition are met

if fld_Generic.Text - "ABC"  AND IsBlank(fld_Relation.Selected.Value)

Then disable the button (DisplayMode.Disabled).

Thanks in Advance

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User III
Super User III

Hi @AlbertoSP 

The syntax looks like this:

If(And(fld_Generic.Text="ABC", IsBlank(fld_Relation.Selected.Value)), 
DisplayMode.Disabled,
DisplayMode.Edit
)

You can also use the && syntax like this:

If(fld_Generic.Text="ABC" && IsBlank(fld_Relation.Selected.Value), 
DisplayMode.Disabled,
DisplayMode.Edit
)

 

View solution in original post

4 REPLIES 4
timl
Super User III
Super User III

Hi @AlbertoSP 

The syntax looks like this:

If(And(fld_Generic.Text="ABC", IsBlank(fld_Relation.Selected.Value)), 
DisplayMode.Disabled,
DisplayMode.Edit
)

You can also use the && syntax like this:

If(fld_Generic.Text="ABC" && IsBlank(fld_Relation.Selected.Value), 
DisplayMode.Disabled,
DisplayMode.Edit
)

 

View solution in original post

rajmilansinh
Advocate IV
Advocate IV

Hey there,

 

So achieve this functionality you have to write if function in button's "DisplayMode" property.

Please refer bewlow screenshot to get more idea on this:

 

disable button.png

Code as per your field and requirement: 

if(fld_Generic.Text = "ABC" &&  IsBlank(fld_Relation.Selected.Value), DisplayMode.Disabled, DisplayMode.Edit)

 

Please mark this as a solution if really helps you.

 

Thanks,

Milansinh Raj

Thank you.

Although the second solution using &&, doidn't seem to work

May I know which connection you are using here ? Dynamics CRM connector or CDS connection ?

Because I have created demo app screen to show solution and I am using Dynamics CRM Connector here.

It is working fine for me.

Let me know so I can get knowledge in which case it cant be work

Smiley Happy

 

Thank you

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (1,893)