Hello
I was hoping someone could help me please
I have a gallery with 15 different questions in it. In each question I have a smiley face icon for Green, Amber and Red
How do I patch all 15 questions all with an individual 'face' please? The source is SharePoint and its just expecting the word Green Amber or Red in a choices column
Thank you in advance
Solved! Go to Solution.
Hi @pricey79 :
I've made a test for your reference:
1\My DataSource:
2\Create a gallery and set it's items property to:
Table({Question:"Q1"},{Question:"Q2"},{Question:"Q3"},{Question:"Q4"},{Question:"Q5"},{Question:"Q6"})
3\Add a green icon(Green) into the gallery and set
OnSelect
RemoveIf(TheResult,Question=ThisItem.Question);Collect(TheResult,{Question:ThisItem.Question,Color:"Green"})
Visible
!IsEmpty(Filter(TheResult,Question=ThisItem.Question && Color = "Green")) || IsEmpty(Filter(TheResult,Question=ThisItem.Question))
4\Add a Yellow icon(Yellow) into the gallery and set
OnSelect
RemoveIf(TheResult,Question=ThisItem.Question);Collect(TheResult,{Question:ThisItem.Question,Color:"Yellow"})
Visible
!IsEmpty(Filter(TheResult,Question=ThisItem.Question && Color = "Yellow")) || IsEmpty(Filter(TheResult,Question=ThisItem.Question))
5\Add a Red icon(Red) into the gallery and set
OnSelect
RemoveIf(TheResult,Question=ThisItem.Question);Collect(TheResult,{Question:ThisItem.Question,Color:"Red"})
Visible
!IsEmpty(Filter(TheResult,Question=ThisItem.Question && Color = "Red")) || IsEmpty(Filter(TheResult,Question=ThisItem.Question))
6\Add a button and set it's OnSelect property to:
Patch(
Bof0329,
Defaults(Bof0329),
{
Title:Now(),
UserName:User().FullName,
Result:CountRows(Filter(TheResult,Color="Green"))&" Green, "& CountRows(Filter(TheResult,Color="Yellow")) & " Yellow, "& CountRows(Filter(TheResult,Color="Red")) & " Red",
DateTime:Now()
}
)
The Result:
Best Regards,
Bof
Hi @pricey79 ,
For your scenario, you have to have a text field in the Feedback column. Just below the 3 smiley icons, but it should not be visible for the user. Make the border of the textbox as white and font of the textbox as white. Link the Textbox to the Data Source of the SharePoint choice / text field value (Feedback).
Hi @pricey79 :
Do you want to update the value of a TheChoiseColumn to Green or Red for all records in the table?
If so, you could try:
UpdateIf(
YourSharePointList,
true,
{TheChoiseColumn:{Value:"Green"}}
)
Best Regards,
Bof
@v-bofeng-msft Thank you for taking the time to reply.
Sorry, but I'm a bit confused.
This is what I have :
I've only shown a snip but there are 15 questions, and someone on a daily basis will answer, by choosing one of the faces.
I need to have 15 answers, for example , 12 green, 3 red with the date they were answered?
What I would I need the onselect of each face to be?
Thank you so much
Hi @pricey79 :
I've made a test for your reference:
1\My DataSource:
2\Create a gallery and set it's items property to:
Table({Question:"Q1"},{Question:"Q2"},{Question:"Q3"},{Question:"Q4"},{Question:"Q5"},{Question:"Q6"})
3\Add a green icon(Green) into the gallery and set
OnSelect
RemoveIf(TheResult,Question=ThisItem.Question);Collect(TheResult,{Question:ThisItem.Question,Color:"Green"})
Visible
!IsEmpty(Filter(TheResult,Question=ThisItem.Question && Color = "Green")) || IsEmpty(Filter(TheResult,Question=ThisItem.Question))
4\Add a Yellow icon(Yellow) into the gallery and set
OnSelect
RemoveIf(TheResult,Question=ThisItem.Question);Collect(TheResult,{Question:ThisItem.Question,Color:"Yellow"})
Visible
!IsEmpty(Filter(TheResult,Question=ThisItem.Question && Color = "Yellow")) || IsEmpty(Filter(TheResult,Question=ThisItem.Question))
5\Add a Red icon(Red) into the gallery and set
OnSelect
RemoveIf(TheResult,Question=ThisItem.Question);Collect(TheResult,{Question:ThisItem.Question,Color:"Red"})
Visible
!IsEmpty(Filter(TheResult,Question=ThisItem.Question && Color = "Red")) || IsEmpty(Filter(TheResult,Question=ThisItem.Question))
6\Add a button and set it's OnSelect property to:
Patch(
Bof0329,
Defaults(Bof0329),
{
Title:Now(),
UserName:User().FullName,
Result:CountRows(Filter(TheResult,Color="Green"))&" Green, "& CountRows(Filter(TheResult,Color="Yellow")) & " Yellow, "& CountRows(Filter(TheResult,Color="Red")) & " Red",
DateTime:Now()
}
)
The Result:
Best Regards,
Bof
Thank you so much, that is amazing , and the disappearing faces is great.
One thing though, sorry!
In SharePoint I get this when patched :
Is there a way to get the individual colours next to the question, so I know what question was green, and which ones were red etc?
Thank you so much
Hi @pricey79 :
You could set the Result column to 'Multiple lines of text' type and turn on the rich text function:
Patch the Result:
Patch(
Bof0329,
Defaults(Bof0329),
{
Title:Now(),
UserName:User().FullName,
Result:CountRows(Filter(TheResult,Color="Green"))&"<font color='Green'> Green</font>, "& CountRows(Filter(TheResult,Color="Yellow")) & "<font color='Yellow'> Yellow</font>, "& CountRows(Filter(TheResult,Color="Red")) & "<font color='Red'> Red</font>",
DateTime:Now()
}
)
Result:
Best Regards,
Bof
Hi @v-bofeng-msft and again thank you for taking the time to reply.
I'm really sorry to be a pain but thats not quite what I meant and its my fault for not giving you more information.
Every day, someone will go to an area and do a checklist against each of the questions, then choose a colour depending on the outcome. This will feed a Power BI Dashboard, which will hopefully show trends against which questions have the most red, or green etc.
So its an individual result each day for each question, so 15 distinct answers every day.
Does that make sense?
Thank you so much for helping
Hi @pricey79 :
I would generally advise against constantly making new requirements in one thread, which is usually not good for problem solving.
If this question also involves integration with PowerBI, I suggest you create a new thread (I have provided a working solution for the initial requirements in this thread) and describe your setup in detail and provide some screenshots.
Best Regards,
Bof
User | Count |
---|---|
255 | |
114 | |
94 | |
48 | |
38 |