cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jackywei_BDF
Super User
Super User

How to set Botton can click when condition is match and Botton can't click when condition is not match?

Dear all:

 

I  working on power apps with sharepoint list.

Now i have a question, how to set Botton can be clicked when condition is match and Botton can't be clicked when condition is not match?

For example:

When approvalStatus = "Approved"  the Botton can be clicked, when approvalStatus <> "Approved", the botton can't be clicked.

 

Thanks for your support:)

1 ACCEPTED SOLUTION

Accepted Solutions

@Jackywei_BDF ,

I was using your code posted here (I cannot see your data). If ApprovalStatus is a Choice column

If(
   approvalStatus.Value = "Approved",
   DisplayMode.Edit,
   DisplayMode.Disabled
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Jackywei_BDF ,

Something like this on the DisplayMode of the Button

If(
   approvalStatus = "Approved",
   DisplayMode.Edit,
   DisplayMode.Disabled
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

@WarrenBelz :

 

Thanks for your reply.

Unfortunatley, it doesn't work.

Please take a look screenshot from my desk.

Jackywei_BDF_0-1654679190227.png

It seems show error as below

Jackywei_BDF_1-1654679271741.png

 

 

@Jackywei_BDF ,

I was using your code posted here (I cannot see your data). If ApprovalStatus is a Choice column

If(
   approvalStatus.Value = "Approved",
   DisplayMode.Edit,
   DisplayMode.Disabled
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

@WarrenBelz :

 

Thanks for your support:

I have settle it by datacardvalue.text

Jackywei_BDF_0-1654681618432.png

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (16,111)