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
Microsoft
Microsoft

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.

 

View solution in original post

2 REPLIES 2
v-jefferni
Microsoft
Microsoft

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.

v-jefferni
Microsoft
Microsoft

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.

 

View solution in original post

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (36,877)