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 / Switch function not ac...
Power Apps
Answered

Switch function not accepting reference to Self

(0) ShareShare
ReportReport
Posted on by 28

I have a text control and I'm using a Switch function on the Color property based on the text value:

 

Switch(Self.Text.Value, "RED", RGBA(204, 51, 51, 1), "GRAY", RGBA(179, 179, 179, 1), "")

 

 

However it returns an error, see below:

switch.png

 

Is there a limitation on referencing "Self" in the Switch (or any other) function?

Categories:
  • Verified answer
    eka24 Profile Picture
    20,925 on at

    Use:

    Switch(Self.Text, "RED", RGBA(204, 51, 51, 1), "GRAY", RGBA(179, 179, 179, 1),RGBA(0,0,0,0))

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
  • caribu Profile Picture
    28 on at

    Of course! 🙂 Thanks for the quick response 🙂

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard