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 / Can't convert from tex...
Power Apps
Unanswered

Can't convert from text to boolean warning

(0) ShareShare
ReportReport
Posted on by

If(DataCardValue59.Selected.Value <> ("9" || "10") && ICEVar = 1, SubmitForm(EditForm2) && Set(PPEVar,2), DataCardValue59.Selected.Value = ("9" || "10") && ICEVar = 1 && EMOBVar = 1, SubmitForm(EditForm2) && Set(PPEVar,2), Set(PPEVar,1))

 

This section of code is just used to adjust 'Var' values to change the text in a label. When I try to compare DataCardValue59 to 9 or 10, I get a blue underline under the "<>" and "=" operators with a warning saying I can't compare text to boolean. I can't figure out what I'm doing wrong since the DataCard and 9 and 10 are all text values.

Categories:
I have the same question (0)
  • shoog Profile Picture
    2,164 on at

    The syntax for 9 or 10 doesn't work that way, you could use:

    If((DataCardValue59.Selected.Value <> "9" && DataCardValue59.Selected.Value <> "10") && ICEVar = 1, SubmitForm(EditForm2) && Set(PPEVar,2), (DataCardValue59.Selected.Value = "9" || DataCardValue59.Selected.Value = "10") && ICEVar = 1 && EMOBVar = 1, SubmitForm(EditForm2) && Set(PPEVar,2), Set(PPEVar,1))

    or alternatively change it to an in operator

    If(DataCardValue59.Selected.Value not in ["9", "10"] && ICEVar = 1, SubmitForm(EditForm2) && Set(PPEVar,2), DataCardValue59.Selected.Value in ["9", "10"] && ICEVar = 1 && EMOBVar = 1, SubmitForm(EditForm2) && Set(PPEVar,2), Set(PPEVar,1))

     

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