cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
vaishalivyas1
Level: Powered On

count no of files in a particular SharePoint folder and update in dynamics

Hi All,

 

I am creating flow with below fucntionality.

1. Whenever record is created in MS CRM create some folder structure in SharePoint. 

2. Count no of files in each folder and update that number in MS CRM.

 

Example: On Create of Account create "Contact" and "Related Document" folders in SharePoint and count files in each folder and update in "Contact count" and "Realted Document Count" fields in Dynamics respectivly.

 

I completed point 1 succesuuflly but I am not able to count no of files in each folder in SharePoint.

 

How can we add filter query on  "Get item" to retrieve and count no of files in that particular  folder

Below is the screen Capture: 1.png2.png

1 ACCEPTED SOLUTION

Accepted Solutions
Willemijn
Level 8

Re: count no of files in a particular SharePoint folder and update in dynamics

Hi, 

 

If you only want to count the files in the specific folder you can maybe use the action 'Send an HTTP request to SharePoint':
image.png

 

As Uri: /_api/web/getfolderbyserverrelativeurl('/sites/testflow/LibraryTitle/foldername')/ItemCount

As a result you get the items in this specific folder. 

 

Hope this helps! Otherwise let me know 🙂

Willemijn

View solution in original post

1 REPLY 1
Willemijn
Level 8

Re: count no of files in a particular SharePoint folder and update in dynamics

Hi, 

 

If you only want to count the files in the specific folder you can maybe use the action 'Send an HTTP request to SharePoint':
image.png

 

As Uri: /_api/web/getfolderbyserverrelativeurl('/sites/testflow/LibraryTitle/foldername')/ItemCount

As a result you get the items in this specific folder. 

 

Hope this helps! Otherwise let me know 🙂

Willemijn

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,743)