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 / Setting a parameter ba...
Power Apps
Unanswered

Setting a parameter based on the fill color of a text box

(0) ShareShare
ReportReport
Posted on by 8

Hello all.  I have created a page in my app where I'd like to send an HTML formatted email where cels in the table are filled with colors found in text boxes within my PowerApp.

 

I have a Text Box called TextSales that contains the following conditional formula in the Fill field

 

If(TextSalesMessage.Text="Proceed with growth",Color.Green,
If(TextSalesMessage.Text="Stop!",Color.Red,Color.Orange))

 

The condition current evaluates to Orange based on the inputs.  I've tried to use Set(Param1, TextSales.Fill) using the OnVisible for the main page with the expectation that Param1 would have a color value that I can use in my outbound email HTML to set the fill color in a table cel.  Unfortunately no matter what I do I cannot get Param1 to work. It appears to have a Color data type, but when I try and inspect it with ColorValue I get an error.  I can't seem to trouble shoot this and it is driving me mad.  Any help you can give will be greatly appreciated.

Categories:
I have the same question (0)
  • Adrià Profile Picture
    69 on at

    Try to set the value of param1 as follows: Set(param1,If(TextSalesMessage.Text="Good answer","Green"...

  • MrSparkle Profile Picture
    8 on at

    I set OnVisible for the page to 

     

    Set(Param1, If(TextSalesMessage.Text="Proceed with growth",Color.Green,
    If(TextSalesMessage.Text="Stop!",Color.Red,Color.Orange)))

     

    I set a Text box to the following to see if Param1 contains the correct value

     

    If(Param1=Color.Orange,1,0)

     

    Param1 should be equal to Color.Orange but it appears that it is something other with a Data Type of Color.  I'm not sure what to do next in order to set Param1 to the correct value.

  • MrSparkle Profile Picture
    8 on at

    You got me thinking about ways to resolve the issue.  I found that I could set the fill for a cel using 

     

    ColorValue("Orange")

     

    So I set OnVisible for the containing page to 

     

    Set(SalesColor1,If(TextSalesMessage.Text="Proceed with growth","Green",
    If(TextSalesMessage.Text="Stop!","Red","Orange")))

     

    Instead of 

     

    Set(SalesColor1,If(TextSalesMessage.Text="Proceed with growth",Color.Green,
    If(TextSalesMessage.Text="Stop!",Color.Red,Color.Orange)))

     

    Then ColorValue(SalesColor1) displays an Orange background as required.  I still don't see why I can't get the proper result by setting the parameter to Color.X, but this work around may be sufficient for now.

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 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard