cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pricey79
Helper V
Helper V

Patching a check box for multiple records from a gallery

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @pricey79 :

I've made a test for your reference:

1\My DataSource:

vbofengmsft_0-1648538964259.png

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:

vbofengmsft_2-1648539281998.png

 

vbofengmsft_1-1648539262220.png

Best Regards,

Bof

 

View solution in original post

8 REPLIES 8
ArchitectMadhan
Super User
Super User

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).

- Architect Madhan

Please click the "Accept as Solution" button and give thumbs up, if it is helpful to you.
v-bofeng-msft
Community Support
Community Support

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 :

pricey79_0-1648537240479.png

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:

vbofengmsft_0-1648538964259.png

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:

vbofengmsft_2-1648539281998.png

 

vbofengmsft_1-1648539262220.png

Best Regards,

Bof

 

@v-bofeng-msft 

Thank you so much, that is amazing , and the disappearing faces is great.

One thing though, sorry!

In SharePoint I get this when patched :

pricey79_0-1648557008335.png

 

 

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:

vbofengmsft_0-1648605724662.png

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:

vbofengmsft_1-1648605781214.png

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

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 (1,219)