cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nagestiada
Post Partisan
Post Partisan

Need suggestions on my survey form

 

nagestiada_0-1600075480806.png

 

I have 6 buttons that when clicked it will turn yellow based on the QRM_1 label on the right side.

Active = yellow.

If(ButtonText = "QRM_1",RGBA(255, 230, 0, 1),RGBA(46, 46, 56, 1)) with this code on every button will just change the value depending on the button.

 

But now I want it to change to green when data is found from the sharepoint list. I have three columns which if turns true the background color of the button will turn green if false, either black or yellow - if clicked (active).

 

I'm not sure on syntax of nested if.

Anyone can help me?

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @nagestiada ,

Do you want to display column fill color based on its value and clicking action?

Could you tell me:
1)what data are these three columns?

2)what is your data source?
3)that controls do you use to display these three columns?
4)whether you put these controls inside the form?

I assume that:

you use sharepoint list as data source, these three columns are text type, you use textinputs to display these three columns, they are in a form.

 

If so, you could set like this:

textinput1's Fill:

If(ThisItem.fieldname1="true",Green,
   If(var,Yellow,
          Black
      )
)

textinput1's OnSelect:

Set(var,true)

//If this field is true, then the textinput fill will be green. If the field is false and you click the textinput , the textinput fill will be yellow. If the field is false and you not click the textinput, the textinput fill will be black.

The left two fields are similar.

textinput2's Fill:

 

If(ThisItem.fieldname2="true",Green,
   If(var1,Yellow,
          Black
      )
)

 

textinput2's OnSelect:

 

Set(var1,true)

 

textinput3's Fill:

 

If(ThisItem.fieldname3="true",Green,
   If(var2,Yellow,
          Black
      )
)

 

textinput3's OnSelect:

 

Set(var2,true)

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yutliu-msft
Community Support
Community Support

Hi @nagestiada ,

Do you want to display column fill color based on its value and clicking action?

Could you tell me:
1)what data are these three columns?

2)what is your data source?
3)that controls do you use to display these three columns?
4)whether you put these controls inside the form?

I assume that:

you use sharepoint list as data source, these three columns are text type, you use textinputs to display these three columns, they are in a form.

 

If so, you could set like this:

textinput1's Fill:

If(ThisItem.fieldname1="true",Green,
   If(var,Yellow,
          Black
      )
)

textinput1's OnSelect:

Set(var,true)

//If this field is true, then the textinput fill will be green. If the field is false and you click the textinput , the textinput fill will be yellow. If the field is false and you not click the textinput, the textinput fill will be black.

The left two fields are similar.

textinput2's Fill:

 

If(ThisItem.fieldname2="true",Green,
   If(var1,Yellow,
          Black
      )
)

 

textinput2's OnSelect:

 

Set(var1,true)

 

textinput3's Fill:

 

If(ThisItem.fieldname3="true",Green,
   If(var2,Yellow,
          Black
      )
)

 

textinput3's OnSelect:

 

Set(var2,true)

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (4,559)