Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Unanswered

Error message converting text to value

(0) ShareShare
ReportReport
Posted on by
Can anyone provide any guidance to how to convert text to a number without getting an error message. This is the If statement I am using. I am comparing 2 numbers from 2 different text controls and attempting to change the fill color of a circle. Everything works properly but I still get an error when the app loads that says "the value 'text' cannot be converted to a number."
 
   If(
        Value(CountActual_4.Text) > Value(CountMinimum_4.Text),
        Color.Green,
        If(
            Value(CountActual_4.Text) = Value(CountMinimum_4.Text),
            Color.Gold,
            Color.Red
        )
    )
 
 
  • scalca Profile Picture
    scalca 180 on at
    Error message converting text to value
    What's the initial value of the text fields ? 
    probably when it loads the app the initial value is some text which cannot be converted and after that you load get some values from a source. 
    you could implement an exception handling mechanism to catch the error using IfError()

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,867

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,174

Leaderboard