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 / Conditional Fill Forma...
Power Apps
Answered

Conditional Fill Formatting of TextBox Dependant on Input

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I think this will be an easy fix just unsure how to do it.

I have an app in which users input a number into a textbox, I have coded the Fill Button of the TextInput so that it changes colour depending on the value inputted, my code is below: 

My issue is that when the TextInput is blank, it is filled Red as the code is saying Fill Red if less than 16.85. I want the TextInput to just be white if it is blank. How can I do this whilst maintaining my current code?

If(
 Value(TextInput_Tempering_Bin_Rear.Text) <=16.85,
 Color.Red,
 If(
 Value(TextInput_Tempering_Bin_Rear.Text) >=16.86 && Value(TextInput_Tempering_Bin_Rear.Text) <=17.15,
 Color.Yellow,
 If(
 Value(TextInput_Tempering_Bin_Rear.Text) = 17.50,
 Color.Green,
 If(
 Value(TextInput_Tempering_Bin_Rear.Text) >=17.51 && Value(TextInput_Tempering_Bin_Rear.Text) <=17.84,
 Color.Yellow,
 Color.Red
 )
 )
 )
)

 

Categories:
I have the same question (0)
  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @Anonymous ,

     

    Is this what you want?

    If(
     IsBlank(Self.Text), Color.White,
     If(
     Value(Self.Text) <=16.85,
     Color.Red,
     If(
     Value(Self.Text) >=16.86 && Value(Self.Text) <=17.15,
     Color.Yellow,
     If(
     Value(Self.Text) = 17.50,
     Color.Green,
     If(
     Value(Self.Text) >=17.51 && Value(Self.Text) <=17.84,
     Color.Yellow,
     Color.Red
     )
     )
     )
     )
    )

     

    Hope this helps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, yes that works perfectly thank you.

    I also have another screen which shows this uploaded data (like a viewer), this has the same issue as my textinput, except this time the code I am using is: How would I solve this?

    If(
     ThisItem.'Tempering Bin Rear (MT2101)' <=16.85,
     Color.Red,
     If(
     ThisItem.'Tempering Bin Rear (MT2101)' >=16.86 && ThisItem.'Tempering Bin Rear (MT2101)' <=17.15,
     Color.Yellow,
     If(
     ThisItem.'Tempering Bin Rear (MT2101)' = 17.50,
     Color.Green,
     If(
     ThisItem.'Tempering Bin Rear (MT2101)' >=17.51 && ThisItem.'Tempering Bin Rear (MT2101)' <=17.84,
     Color.Yellow,
     Color.Red
     )
     )
     )
    )

     

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @Anonymous ,

     

    You need to add Value()

    Value(ThisItem.'Tempering Bin Rear (MT2101)')

     

    Hope this helps

     

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
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard