cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dennisb88
Responsive Resident
Responsive Resident

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
Super User
Super User

@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")

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!

Users online (1,656)