Count column choices in Microsoft Lists

Jose L Rodriguez 10 Reputation points
2023-04-05T16:22:08.12+00:00

Hello all! I am using Microsoft Lists/Sharepoint Lists to create a scorecard. Each of the entries in the lists are tasks. On my list, I have four choice columns, representing four different sections of the scorecard. The list of choices for these columns are basically issues found on that specific task. I need to create a fifth column, which will sum or count the amount of “issues” for each task. Example: Task “123” has two issues under column A, two under column B, two under column C and two under column D; therefore, I need my fifth column to show a total of 8 issues. Choices are not numeric values. The choices are text strings. Any help will be greatly appreciated!

Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

3 answers

Sort by: Most helpful
  1. AllenXu-MSFT 24,981 Reputation points Moderator
    2023-04-06T07:29:39.1233333+00:00

    Hi @Jose L Rodriguez,

    Build a Power Automate flow like below: User's image

    Use the expression to count column(number type): add(length(triggerOutputs()?['body/choicecolumn1']),length(triggerOutputs()?['body/choicecolumn2']), length(triggerOutputs()?['body/choicecolumn3']), length(triggerOutputs()?['body/choicecolumn4']))

    triggerOutputs()?['body/choicecolumn'] is selected from Dynamic Content > column name.

    Test result: User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

  2. Fetsis, Spyros 5 Reputation points
    2023-08-31T05:45:50.08+00:00

    I have a similar situation but instead of adding columns I just need to count the number of choices in a single column, provide that number in a new column and then let Sharepoint sum up that column. I have tried removing the "add" and it works somewhat the problem that I am having is I get "null" errors during the update items part of the flow. I have a filter array to ignore fields that are empty but that is not doing the trick. I saw a similar post where the author used length(string(....but all that did was put zeros in my column, but no errors! any additional guidance?

    1 person found this answer helpful.

  3. AllenXu-MSFT 24,981 Reputation points Moderator
    2023-05-04T06:17:33.3133333+00:00

    Hi @Jose L Rodriguez,

    I will be grateful if you can share here the result of the flow in your environment. If you are not satisfied with the method integrated with Power Automate flow and finding OOTB ways, I suggest you can raise a new thread in the SharePoint feedback portal: https://feedbackportal.microsoft.com/feedback/forum/06735c62-321c-ec11-b6e7-0022481f8472. Microsoft will take your feedback into consideration and roll it out if it is highly voted.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.