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 ?
Solved! Go to Solution.
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.
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
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.
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
}
)
)