web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to show select ite...
Power Apps
Unanswered

How to show select items from a SharePoint Lis - button color changes

(0) ShareShare
ReportReport
Posted on by 49

Hello ,

Every time this page (form) is loaded, import data from the Bbua1 column and put it in TestButton1.Text. 0 represents white color of the button and the label '0' - 1 represents green color of the button and the label '1'. Each click changes the value to the opposite one.

Form1.Items : LookUp(AnswersChecklisteApp;IDUser="1")
TestButton1.Text : LookUp(AnswersChecklisteApp;IDUser = "1";Bbua1)

TestButton.OnSelected : 

UpdateContext({pressedButton:!pressedButton});;
If(pressedButton;TestButton1.Text="1";TestButton1.Text="0"

 

TestButton1.Fill : If(pressedButton;Color.DarkGreen;Color.White)

 

Problem1.png

 

Categories:
I have the same question (0)
  • Verified answer
    v-mingkz-msft Profile Picture
    Microsoft Employee on at
    Re: How to show select items from a SharePoint Lis - button color changes

    Hi @ReeX,

    Do you want to display the different color and text of label according to the SP list data?
    If the Bbua1 = 1 display the green color and text '1' in label?
    If the Bbus1 = 0, display the white color and text '0' in label?
    If click the label display the opposite one?

     

    I did some test according to your requirements.

    1. Set the Item property of Form as:

    LookUp(AnswersChecklistApp,IDUser = 1)

    2. Set the OnSelect property of Button as:

    Set(color,LookUp(AnswersChecklistApp,IDUser = 1).Bbua1 <> 0)

    vmingkzmsft_0-1687333318844.png

    3. Set the OnSelect property of Label as:

    Set(color,!color)

    4. Set the Fill property of Label as:

    If(color = true, Color.DarkGreen,color = false, Color.White)

    5. Set the Default property of Label as:

    If(color = true,"1",color = false,"0")

     

     

    Best Regards,

    Kyrie

  • ReeX Profile Picture
    49 on at
    Re: How to show select items from a SharePoint Lis - button color changes

    Hi @v-mingkz-msft ,

     

    Thanks 😄 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 836 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 231 Super User 2025 Season 2

Last 30 days Overall leaderboard