cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ashokpershad
Kudo Kingpin
Kudo Kingpin

OptionSetValue and Text

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
ashokpershad
Kudo Kingpin
Kudo Kingpin

@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.

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

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

ashokpershad
Kudo Kingpin
Kudo Kingpin

@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.

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

 

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.

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,510)