cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Running Total and joining sharepoint lists

I have two sharepoint lists:  IDEAS and VOTES  I need to capture the running total of Yes votes for each idea.  The IDEAS list has a field called THUMBSUPCOUNT that I can use to store the running total of Yes votes.  How do I join the tables and patch the running total back to the IDEAS.THUMBSUPCOUNT field?

 

gidea1.PNGgidea2.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Running Total and joining sharepoint lists

Hi @Anonymous ,

Could you please share a bit more about the "GoodIdea" column in your VOTES List? Is it a Choice type column or Single line text type column?

Do you want to patch the running total of Yes votes for each idea back to the THUMBSUPCOUNT field in your Ideas List?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

1. If the "GoodIdea" column is a Single line text type column in your VOTES List:

Set the OnSelect property of the "Submit" button to following:

ForAll(
          RenameColumns(IDEAS, "ID", "ID1"),
          Patch(
                    IDEAS,
                    LookUp(IDEAS, ID = ID1),
                    {
                       THUMBSUPCOUNT: CountRows(Filter(VOTES, IDIdea = ID1 && GoodIdea = "Yes"))
                    }
          )
)

 

2. If the "GoodIdea" column is a Choice type column in your VOTES List:

Set the OnSelect property of the "Submit" button to following:

ForAll(
          RenameColumns(IDEAS, "ID", "ID1"),
          Patch(
                    IDEAS,
                    LookUp(IDEAS, ID = ID1),
                    {
                       THUMBSUPCOUNT: CountRows(Filter(VOTES, IDIdea = ID1 && GoodIdea.Value = "Yes"))
                    }
          )
)

 

In addition, if the IDIdea column is a LookUp type column in your VOTES list, please modify above formula as below:

ForAll(
          RenameColumns(IDEAS, "ID", "ID1"),
          Patch(
                    IDEAS,
                    LookUp(IDEAS, ID = ID1),
                    {
                       THUMBSUPCOUNT: CountRows(Filter(VOTES, IDIdea.Value = ID1 && GoodIdea = "Yes"))
                    }
          )
)

 

ForAll(
          RenameColumns(IDEAS, "ID", "ID1"),
          Patch(
                    IDEAS,
                    LookUp(IDEAS, ID = ID1),
                    {
                       THUMBSUPCOUNT: CountRows(Filter(VOTES, IDIdea.Value = ID1 && GoodIdea.Value = "Yes"))
                    }
          )
)  

More details about Patch function, ForAll function and RenameColumns function, please check the following article:

ForAll function

Patch function 

RenameColumns function

 

Best regards,

Community Support Team _ Kris Dai
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
Highlighted
Community Support
Community Support

Re: Running Total and joining sharepoint lists

Hi @Anonymous ,

Could you please share a bit more about the "GoodIdea" column in your VOTES List? Is it a Choice type column or Single line text type column?

Do you want to patch the running total of Yes votes for each idea back to the THUMBSUPCOUNT field in your Ideas List?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

1. If the "GoodIdea" column is a Single line text type column in your VOTES List:

Set the OnSelect property of the "Submit" button to following:

ForAll(
          RenameColumns(IDEAS, "ID", "ID1"),
          Patch(
                    IDEAS,
                    LookUp(IDEAS, ID = ID1),
                    {
                       THUMBSUPCOUNT: CountRows(Filter(VOTES, IDIdea = ID1 && GoodIdea = "Yes"))
                    }
          )
)

 

2. If the "GoodIdea" column is a Choice type column in your VOTES List:

Set the OnSelect property of the "Submit" button to following:

ForAll(
          RenameColumns(IDEAS, "ID", "ID1"),
          Patch(
                    IDEAS,
                    LookUp(IDEAS, ID = ID1),
                    {
                       THUMBSUPCOUNT: CountRows(Filter(VOTES, IDIdea = ID1 && GoodIdea.Value = "Yes"))
                    }
          )
)

 

In addition, if the IDIdea column is a LookUp type column in your VOTES list, please modify above formula as below:

ForAll(
          RenameColumns(IDEAS, "ID", "ID1"),
          Patch(
                    IDEAS,
                    LookUp(IDEAS, ID = ID1),
                    {
                       THUMBSUPCOUNT: CountRows(Filter(VOTES, IDIdea.Value = ID1 && GoodIdea = "Yes"))
                    }
          )
)

 

ForAll(
          RenameColumns(IDEAS, "ID", "ID1"),
          Patch(
                    IDEAS,
                    LookUp(IDEAS, ID = ID1),
                    {
                       THUMBSUPCOUNT: CountRows(Filter(VOTES, IDIdea.Value = ID1 && GoodIdea.Value = "Yes"))
                    }
          )
)  

More details about Patch function, ForAll function and RenameColumns function, please check the following article:

ForAll function

Patch function 

RenameColumns function

 

Best regards,

Community Support Team _ Kris Dai
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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,128)