cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ed_Cheung
New Member

Not work when Set DisplayMode to Disabled by if condition

The Problem is when I only type in title and issue description the create button change to edit mode, it seem did not check the site and categories fields.

I tested I choose a value of categories choice and cancel it, then it work. So I set the default and DefaultSelectedItem to Blank(), it still not work on initial state. Any thing I done wrong?
 Capture1.PNG
Ed_Cheung_0-1609926429472.png
I using SharePoint list to store the information.
Title data type: text
Issue description data type: text
Site data type: choice
Categories data type: choice

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Ed_Cheung ,

 

After a bit more test I found that IsBlank(Combobox.Selected) would return true if nothing selected in the combo box:

98.png

 

So you need to replace that two IsEmpty() function with IsBlank():

If(
   IsBlank(Title_DCValue_CreateForm.Text) ||
   IsBlank(IssueDescription_DCValue_CreateForm.Text) ||
   IsBlank(Site_DCValue_CreateForm.Selected) ||
   IsBlank(Categories_DCValue_CreateForm.Selected),
   DisplayMode.Disabled,
   DisplayMode.Edit
)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

 

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-jefferni
Community Support
Community Support

Hi @Ed_Cheung ,

 

The reason is even if no item is selected in the Combo box, by default, there is a Blank() record in it. Only if you select some item then de-select it IsEmpty() would return true. See below screenshots:

89.png.

91.png

 

So, for above reason, IsBlank() is the way to achieve your goal.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

v-jefferni
Community Support
Community Support

Hi @Ed_Cheung ,

 

After a bit more test I found that IsBlank(Combobox.Selected) would return true if nothing selected in the combo box:

98.png

 

So you need to replace that two IsEmpty() function with IsBlank():

If(
   IsBlank(Title_DCValue_CreateForm.Text) ||
   IsBlank(IssueDescription_DCValue_CreateForm.Text) ||
   IsBlank(Site_DCValue_CreateForm.Selected) ||
   IsBlank(Categories_DCValue_CreateForm.Selected),
   DisplayMode.Disabled,
   DisplayMode.Edit
)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

 

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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 (1,041)