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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / OptionSetValue and Text
Power Apps
Answered

OptionSetValue and Text

(0) ShareShare
ReportReport
Posted on by 321

I have one dataverse table Customer where I have 3 columns: UEmail (text type), Validity (Choice: Monthly, Yearly) and StartDate (Dateonly Type)

 

I am using below formula for OnVisible property of one screen. 

If(LookUp(Customer, UEmail = User().Email && Validity = "Monthly").StartDate < DateAdd(Today() , 30) , UpdateContext({expval:true}))

I am getting error: 

Incompatible type of comparisons. These types cannot be compared. OptionSetValue and Text

 

Any solution to above error ?

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,752 Most Valuable Professional on at

    Hi @ashokpershad ,

    You need Validity.Value, but this should also help with Delegation

    With(
     { 
     wDate:
     DateAdd(
     Today(),
     30,
     Days
     )
     },
     UpdateContext(
     { 
     expval:
     LookUp(
     Customer, 
     UEmail = User().Email &&
     Validity.Value = "Monthly"
     ).StartDate < wDate
     }
     )
    )

     

    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

  • Verified answer
    ashokpershad Profile Picture
    321 on at

    @WarrenBelz 

    Thanks a lot for your reply. It does work. 

    I have found another very simple way to get rid of this optionsetvalue error.

    While creating New Choice set values in dataverse we were asked to write "Display Name" (this is display name of choices not column) for it let say we name it "Valid". 

    Now while writing formula we just need to use both these

     

    If(LookUp(Customer, UEmail = User().Email && Validity = Valid.Monthly).StartDate < DateAdd(Today() , 30) , UpdateContext({expval:true}))

     

     It works perfectly fine.

  • WarrenBelz Profile Picture
    155,752 Most Valuable Professional on at

    @ashokpershad ,

    I just noticed you used Dataverse - my response was more SharePoint based - back to my original point

    With(
     { 
     wDate:
     DateAdd(
     Today(),
     30,
     Days
     )
     },
     UpdateContext(
     { 
     expval:
     LookUp(
     Customer, 
     UEmail = User().Email &&
     Validity = Valid.Monthly
     ).StartDate < wDate
     }
     )
    )

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard