cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zachm
Microsoft
Microsoft

Disable button based on dataverse choice field

I have a multi screen PowerApp that leverages a collection to collate the information entered. That colllection has one record that is displayed on the final page and the patched into the database. colNewJD is the variable that is passed between each page and patched to ensure that it has the users changes/updates.

 

I want to be able to disable the button if the record being viewed is being processed. The following code is being put in the button's DisplayMode field. I cannot access ThisItem.'Flow State' because it is in a Form, and the button is on the outside of the form.

 

If(First(colNewJD).'Flow State'='Flow State (Job Description Verifications)'.Processing,
FormMode.View,
FormMode.Edit
)

 

Problem: I am pretty sure my logical test is comparing different types, but I can't figure out what needs to change. The error message is "Expected enum value"

1 ACCEPTED SOLUTION

Accepted Solutions
zachm
Microsoft
Microsoft

Welp. I was very close. I used the wrong Mode. i needed DisplayMode not FormMode.

 

If(First(colNewJD).'Flow State'='Flow State (Job Description Verifications)'.Processing,
DisplayMode.Disabled,
DisplayMode.Edit
)

View solution in original post

1 REPLY 1
zachm
Microsoft
Microsoft

Welp. I was very close. I used the wrong Mode. i needed DisplayMode not FormMode.

 

If(First(colNewJD).'Flow State'='Flow State (Job Description Verifications)'.Processing,
DisplayMode.Disabled,
DisplayMode.Edit
)

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (5,152)