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
Solved! Go to Solution.
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
)
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
)
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:
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
Thank you
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
186 | |
52 | |
50 | |
34 | |
33 |
User | Count |
---|---|
268 | |
97 | |
84 | |
72 | |
71 |