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
Answered

Send Email When New File is Uploaded to SP Doc library

(0) ShareShare
ReportReport
Posted on by 20

I'm trying to get a Flow to send an email when a new file is uploaded to a SPO doc library. I start with a 'When a file is created or modified (properties only)' action. Then 'Get files (properties only)' action followed by two Compose actions; Compose URL and Compose uriPath Function.

 

Getting an error "The input parameter(s) of operation 'Compose_uriPath_Function' contains invalid expression(s). Fix invalid expression(s) for the input parameter(s) of operation 'Compose_uriPath_Function'."

 

The 'Compose_uriPath_Function' is @uriPath(outputs_Compose_URL).

 

Can someone please let me know what I'm doing wrong?

 

Thanks,

John

I have the same question (0)
  • David_MA Profile Picture
    12,525 Super User 2025 Season 2 on at
    Re: Send Email When New File is Uploaded to SP Doc library

    In a compose action, the expression would not begin with @. You use the @ with a trigger condition.

  • jmoss5 Profile Picture
    20 on at
    Re: Send Email When New File is Uploaded to SP Doc library

    OK, thanks for that info. I removed the @ and the flow sends the email, but it doesn't include the link to the document. It only has this: uriPath(outputs_Compose_URL)

     

    What else do I need to do to get an active link to the newly uploaded doc?

     

    Thanks Much!

  • David_MA Profile Picture
    12,525 Super User 2025 Season 2 on at
    Re: Send Email When New File is Uploaded to SP Doc library

    When composing the e-mail, insert the dynamic content link to item, which will come from the trigger condition.

    David_MA_0-1709054539037.png

     

  • jmoss5 Profile Picture
    20 on at
    Re: Send Email When New File is Uploaded to SP Doc library

    I added that, but all I get is ']}

     

    Also, when I add anything to the body of the Send an email (V2) action, a 'For Each' section is added above the Send Email action. Them I get an email for every document in the doc library. I limited the workflow to a specific View, but I get email for all docs.

     

    What am I doing? Something hugely wrong 🙂

  • David_MA Profile Picture
    12,525 Super User 2025 Season 2 on at
    Re: Send Email When New File is Uploaded to SP Doc library

    I would need to see your workflow so I know what you are doing. Whenever you use a Get files action that returns an array (multiple items). So, when you send an e-mail with data that comes from an array, it will put it into an Apply to each action. Based on the original post, I don't understand the need for the Get files action since your trigger is When a new file (singular) is uploaded.

     

    I think instead of the Get files (plural) properties only you want to use the Get file (singular action) properties only. Get file would return one file (details of the file that was created, which is what I am guessing you want) and when you use data from that in your e-mail it will not put it into an Apply to each action.

  • jmoss5 Profile Picture
    20 on at
    Re: Send Email When New File is Uploaded to SP Doc library

    This is for newsletters uploaded to SharePoint. I have ~30 titles I upload daily, weekly, monthly, etc. I want the flow to send an email with a link to the document.

     

    I changed the action to 'Get file properties'. I didn't notice the difference before.

     

    How do I get the Id? It says 'Unique Identifier'. The newsletter will not have the same file name. I name them with the issue date, since there will be multiple issues with the same title; i.e. IECAR02152024 for the 2/15/2024 issue of 'Inside EPAs Clean Air Report'. Next issue in 2 weeks will be named IECAR02292024.

     

    Thanks

  • David_MA Profile Picture
    12,525 Super User 2025 Season 2 on at
    Re: Send Email When New File is Uploaded to SP Doc library

    I would need to see a screen shot of your flow to know how it is configured in order to answer your question. Please upload a screen shot of your flow that shows how you have configured the actions.

  • jmoss5 Profile Picture
    20 on at
    Re: Send Email When New File is Uploaded to SP Doc library

    here's the screenshot

    FlowScreenshot02282024.png

    Thanks

  • David_MA Profile Picture
    12,525 Super User 2025 Season 2 on at
    Re: Send Email When New File is Uploaded to SP Doc library

    Based on the screen shot, something is not correctly configured in the Get file properties action. I need to see what you have the properties set to. You want to make sure it is using the ID that comes from the trigger action When a file is created or modified.

  • jmoss5 Profile Picture
    20 on at
    Re: Send Email When New File is Uploaded to SP Doc library

    Screenshot 1

    WhenFileisCreated.png

    Screenshot 2

    GetFileProperties.png

    Screenshot 3

    ForEach.png

    You said I need to use the same ID in Get File Properties action that is used in When File is Uploaded. How do I add an ID to When File is Uploaded action? I use 'Limit Column by Views'.


    Thanks

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

Coming soon: forum hierarchy changes

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

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 535 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 348 Moderator

#3
developerAJ Profile Picture

developerAJ 262

Last 30 days Overall leaderboard