web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / OptionsetValue and Tex...
Power Apps
Unanswered

OptionsetValue and Text comparison error

(0) ShareShare
ReportReport
Posted on by 108

I have one dataverse table TabStat where I have one choice column TActive and another column TEmail. This choice column has two choices Vacant, Occupied

I have another table TabUp which have one column TabEmail

I put this TabUp table in gallery and added one Label control where I want to count the number of rows in table TabStat where TEmail is matching with ThisItem.TabEmail and TActive = "Occupied"

I use below formula but I am getting "Incompatible types of comparison, OptionSetValue cannot be compared with Text" error. 

CountRows(Filter(TabStat,ThisItem.TabEmail = TEmail && 'TActive (TabStat)'.Occupied = "Occupied"))

Even If I use Text to convert OptionSetValue to text, I get Delegation warning and formula doesn't work.

CountRows(Filter(TabStat,ThisItem.TabEmail = TEmail && Text('TActive (TabStat)'.Occupied) = "Occupied"))

I tried using WITH function but still error is not going.

Could anyone help, I always face issue with OPTIONSETVALUE kind of columns.

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at
    CountRows(Filter(TabStat,ThisItem.TabEmail = TEmail, 'TActive (TabStat)'.Occupied.Value = "Occupied"))

     

    Assumig that Occupied is a choice field

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    My website!

    My blog!

  • Manan-Malhotra Profile Picture
    621 Super User 2024 Season 1 on at

     

    @Pershad 

    CountRows(Filter(TabStat,ThisItem.TabEmail = TEmail && 'TActive (TabStat)' = 'TActive (TabStat)'.Occupied))

     

     

    Please Accept as Solution if it solves your question Or just give it a Thumbs Up if it is helpful because this can help others.

    LinkedIn: https://www.linkedin.com/in/manan-malhotra-vfx/

    Want to support me! Buy me a Cup of Coffee?

  • Pershad Profile Picture
    108 on at

    @Nogueira1306 

    I tried adding Value but its giving error "Name isn't valid. Value isn't recognized"

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    what type of field is the

    'TActive (TabStat)'

  • Pershad Profile Picture
    108 on at

    @Manan-Malhotra  Not working, now error coming "OptionSet('TActive(TabStat)') and OptionSetValue('TActive(TabStat)') cannot be compared"

  • Pershad Profile Picture
    108 on at

    @Nogueira1306 Its a CHOICE field

  • Manan-Malhotra Profile Picture
    621 Super User 2024 Season 1 on at

     

    CountRows(Filter(TabStat,ThisItem.TabEmail = TEmail && ThisItem.'TActive (TabStat)' = 'TActive (TabStat)'.Occupied))

     

    I am assuming you are using dataverse with a choice column  @Pershad 

    Try this code, hope this helps

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at
    CountRows(Filter(TabStat,ThisItem.TabEmail = TEmail, 'TActive (TabStat)'.Value = "Occupied"))
  • Pershad Profile Picture
    108 on at

    @Nogueira1306  @Manan-Malhotra 

    Still not resolved. I am using below formula, there is no error but same time there is no output result in control. It's showing blank. For moment there was error related to some enumb & strng & equal etc.. but that too gone now.

    CountRows(Filter(TabStat,ThisItem.TabEmail = TEmail , Text('TActive (TabStat)'.Occupied) = "Occupied" ))

     

  • Pershad Profile Picture
    108 on at

    @Nogueira1306  @Manan-Malhotra 

    I am getting this error now for my last comment formula. 

    Pershad_0-1664639159125.png

     

    This error only coming when opening app but not while editing app.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard