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
Super User

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
Super User

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (2,236)