web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create unique Sharepoi...
Power Automate
Unanswered

Create unique Sharepoint List B with count of occurences from Sharepoint List A

(0) ShareShare
ReportReport
Posted on by 9

Hi there, 

I have a sharepoint list A, that lists all the report rows with 1 column set as a report reference code. 
For example,
Row 1 refers to report#01 row 1, Report reference column "Report #01"
Row 2 refers to report#02 row 1, Report reference column "Report #02"

Row 3 refers to report#03 row 2, Report reference column "Report #03"


I have been trying to count the "Report reference column" into a separate summary sharepoint list B, such that, All unique values in "Report reference column" is listed and "count of occurence from Sharepoint List A. 
Report#01 Count 1
Report#02 Count 2

 

Can anyone help, please.

Kind regards

t

Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    Chriddle_0-1711527895171.png

    Compose

    [
    {"RefersTo": "report#1"},
    {"RefersTo": "report#1"},
    {"RefersTo": "report#2"},
    {"RefersTo": "report#1"},
    {"RefersTo": "report#2"},
    {"RefersTo": "report#1"},
    {"RefersTo": "report#3"},
    {"RefersTo": "report#1"},
    {"RefersTo": "report#1"},
    {"RefersTo": "report#3"},
    ]

     

    Select

    From

    union(
    	xpath(
    	 xml(
    		json(
    		 concat(
    			'{"Root":{"Item":',
    		 outputs('Compose'),
    			'}}'
    		 )
    		)
    	 ),
    	 '//RefersTo/text()'
    	),
    	json('[]')
    )

    Map Report

    item()

    Map Count

    xpath(
     xml(
    	json(
    	 concat(
    		'{"Root":{"Item":',
    	 outputs('Compose'),
    		'}}'
    	 )
    	)
     ),
     concat('count(//Item[RefersTo="', item(), '"])')
    )

     

    Result

    [
     {
     "Report": "report#1",
     "Count": 6
     },
     {
     "Report": "report#2",
     "Count": 2
     },
     {
     "Report": "report#3",
     "Count": 2
     }
    ]

     

  • Tiang8383 Profile Picture
    9 on at

    Hi Chriddle, 

    How to post the results of the count into the Sharepoint List B?

  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    Within an Apply to each, check if there is already an item with the report value in this list.

    If so, update the item, if not create a new one.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard