cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dennisb88
Resolver III
Resolver III

If Statement for a dataverse Yes/No record

Hi all,

 

I've a dataverse database. 

In my database I've a yes/no column, called tasktype.

When I try to set a label in my gallery that show the name record when task type is set on Yes and if it's Set on No, it should be show the value of a dropdownlist.

Now I'm strubeling to achieve this. (I've done it a lot of times with SharePoint as datasource, but now with dataverse it will not work properly.)

 

My formula:

 

If(ThisItem.TaskType ="Yes",ThisItem.Name,ThisItem.'Task (Pre_task)')

 

 

 

Does anyone how to achieve it / Why it's not working?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
haroldbk_msft
Community Support
Community Support

Since TaskType is a Yes/No field which is an Option set use

You can do something like this:

If(ThisItem.TaskType, "Red", "blue")

View solution in original post

2 REPLIES 2
Prakash4691
Post Prodigy
Post Prodigy

@dennisb88 ,

 

If you are setting it for a label, you will not get "ThisItem" object instead use "BrowseGallery1.Selected.yourfield".

 

If you are trying to set for any datacard, a field which available in table/entity then ThisItem object will be available.

 

Try below, I have used custom label. To check for optionset, you have to use optionset value instead of string like below.

 

Find is yes or no option set with values allowed and not allowed.

 

If(BrowseGallery1.Selected.Find = 'A Yes or No boolean'.Allowed, BrowseGallery1.Selected.Name, "yes")

 

If it answers your question, kindly give kudo and accept is as solution.

 

 

Regards,

Prakash

haroldbk_msft
Community Support
Community Support

Since TaskType is a Yes/No field which is an Option set use

You can do something like this:

If(ThisItem.TaskType, "Red", "blue")

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,095)