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

Can't convert from text to boolean warning

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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:
  • 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard