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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Send emails to the users who created the file(s) on SharePoint

(0) ShareShare
ReportReport
Posted on by 10

Hi,
I am currently building a flow where everyday a scan of a floder is done and every file which was created from yesterday to the time the flow runs, an email will be sent to the users who created the files and a group mailbox.

 

I have the same question (0)
  • MarcelLehmann Profile Picture
    378 on at
    Re: Send emails to the users who created the file(s) on SharePoint
    1. Create a new daily scheduled flow using "Recurrence" trigger.
    2. Add the "List folder" action for your cloud storage (OneDrive, SharePoint, etc.), and point to your folder.
    3. Add "Filter array" action, using "value" from "List folder" as input. Set condition at advanced to filter files created since yesterday:
      1. @And(greaterOrEquals(item()?['Created'], addDays(utcNow(), -1)),lessOrEquals(item()?['Created'], utcNow())) 
    4. Ad a "For each" loop with "Body" from "Filter array" as input.
    5. Inside the loop, add "Send an email" action
  • VictorIvanidze Profile Picture
    12,851 on at
    Re: Send emails to the users who created the file(s) on SharePoint

    Hi @MarcelLehmann,

    I don't think a user who uploaded 10 files should get 10 emails - but it's certainly  a decision of @MathieuL ...

  • MathieuL Profile Picture
    10 on at
    Re: Send emails to the users who created the file(s) on SharePoint

    Yeah I agree. I would like to minimize the number of emails that are sent.
    If a user added 10 files, he/she should only get one email with the 10 files listed in it as long as it's feasable.

     

  • MarcelLehmann Profile Picture
    378 on at
    Re: Send emails to the users who created the file(s) on SharePoint

    just copy the code below to your flow - then you'll Get all files per user from last 24 hours as a html table to send wherever you want

    JUST add your paramter to the ParseJSON at the beginning
    -> how to add the code to powerauomte, look here PowerPlatformTip 12 – ‘Components for PowerAutomate’

    {"id":"f195667a-1f65-44fe-ada1-1507a21f84e3","brandColor":"#8C3900","connectionReferences":{"shared_sharepointonline":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline/connections/d14e95cef87941198ff344105d36c027"}}},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Get_all_files_per_user_from_last_24_hours","operationDefinition":{"type":"Scope","actions":{"Parse_JSON":{"type":"ParseJson","inputs":{"content":{"YourSite":"MarcelsData","YourLibrary":"Shared%20Documents","YourFolder":"Temp","YesterdayTime":"@adddays(utcnow(),-1)"},"schema":{"type":"object","properties":{"YourSite":{"type":"string"},"YourLibrary":{"type":"string"},"YourFolder":{"type":"string"},"YesterdayTime":{"type":"string"}}}},"runAfter":{},"metadata":{"operationMetadataId":"16d02094-86c2-4abb-845d-985da2ce7e35"}},"Send_an_HTTP_request_to_SharePoint":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_sharepointonline","operationId":"HttpRequest","apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline"},"parameters":{"dataset":"https://lehmannws.sharepoint.com/sites/MarcelsData","parameters/method":"GET","parameters/uri":"_api/web/GetFolderByServerRelativeUrl('/sites/MarcelsData/Shared Documents/Temp')/Files?$select=Name,Author/Name,Author/EMail&$expand=Author&$filter=TimeCreated ge datetime'@{body('Parse_JSON')?['YesterdayTime']}' and TimeCreated lt datetime'@{utcnow()}'&$top=1000"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{"Parse_JSON":["Succeeded"]},"metadata":{"operationMetadataId":"8fc4e863-ea97-46aa-9700-fab79265fc76"}},"Select_Creator":{"type":"Select","inputs":{"from":"@body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']","select":"@item()?['Author']?['Email']"},"runAfter":{"Send_an_HTTP_request_to_SharePoint":["Succeeded"]},"metadata":{"operationMetadataId":"ddf70049-c4ea-40b9-8df7-7663d586dd08"}},"Distinct_the_Creators":{"type":"Compose","inputs":"@union(body('Select_Creator'),body('Select_Creator'))","runAfter":{"Select_Creator":["Succeeded"]},"metadata":{"operationMetadataId":"93a8e53c-020f-48f8-97bb-a7976c2267c3"}},"Apply_to_each":{"type":"Foreach","foreach":"@outputs('Distinct_the_Creators')","actions":{"Current_author":{"type":"Compose","inputs":"@item()","runAfter":{},"metadata":{"operationMetadataId":"1d14547c-5118-4066-8315-17edacf7a317"}},"Filter_array_-_Files_from_this_one_Author":{"type":"Query","inputs":{"from":"@body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']","where":"@contains(item()?['Author']?['Email'], '')"},"runAfter":{"Current_author":["Succeeded"]},"metadata":{"operationMetadataId":"d0a5177b-7551-4e07-8cbf-a67d600f4789"}},"Create_HTML_table_with_all_data_from_the_file":{"type":"Table","inputs":{"from":"@body('Filter_array_-_Files_from_this_one_Author')","format":"HTML","columns":[{"header":"FileName","value":"@item()?['Name']"}]},"runAfter":{"Filter_array_-_Files_from_this_one_Author":["Succeeded"]},"metadata":{"operationMetadataId":"312f5fb6-82b4-48e5-9b20-dbd7a556a5f9"}}},"runAfter":{"Distinct_the_Creators":["Succeeded"]},"metadata":{"operationMetadataId":"b3ae2740-439c-4f1a-868f-dced1ced4ba5"}}},"runAfter":{"FormsInput":["Succeeded"]}}}

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 666 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 382 Moderator

#3
developerAJ Profile Picture

developerAJ 254

Last 30 days Overall leaderboard