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 / Creation file trigger ...
Power Automate
Unanswered

Creation file trigger flow

(0) ShareShare
ReportReport
Posted on by

hi all,

 

I created a simple schedule flow that should advise with an email for a new file creation in Onedrive folder (/Documents/Notifications)

step 1:

i selected "Automated cloud flow" > created the recurrency - ok

when i need to select the file name, i want to use the dynamic content (every time is a different file name) so i put this string:

'split(triggerBody()?['/Documents/Notifications'],'/').last()'.   and i got this error: 

"One or more fields provided is of type 'Null', a different type is expected."

 

what the problem? is the the string?

any of those strings doesn't work:

 

split(triggerBody()?['/Documents/Notifications'],'/')
or 
last(split(triggerBody()?['path'], '/'))
or 
last(split(triggerBody()?['/Documents/Notifications'], '/'))
 
 

Daniel2024_0-1716125766065.png

the error

Daniel2024_1-1716121780131.png

 

Thanks !

Categories:
I have the same question (0)
  • v-yetonggu-msft Profile Picture
    on at

    Hi @Daniel2024 ,

    Where are your files? There are no attributes to reference in your trigger, so flow will report a null error.

     

    Best Regards,

    Sunshine Gu

  • Daniel2024 Profile Picture
    on at

    not exactly,

    there are some files and some are "new" to let the flow to recognize them

    please see the folder status below

    Daniel2024_0-1716183952443.png

     

  • v-yetonggu-msft Profile Picture
    on at

    Hi @Daniel2024 ï¼Œ

    Maybe there is something wrong with my description.

    I am not asking where your files are stored.

    I want to ask if there are triggers and controls for getting files in your flow.

    If you want to get the name of the file, you must first know how to get the file.

    If I guess correctly, do you want to extract the attachment name from the email?

     

    Best Regards,

    Sunshine Gu

  • Daniel2024 Profile Picture
    on at

    hi, you are correct

    the flow meaning is to advise that a new file was created and to send the file name by email to someone

    can you please advise if the flow process is wrong and how should be?

    thanks !

  • v-yetonggu-msft Profile Picture
    on at

    Hi @Daniel2024 ï¼Œ

    Do you want to check whether there are new files created every day, and if so, send all the newly created files through one email, or do you want to send an email notification every time a file is created?

     

    Best Regards,

    Sunshine Gu

  • Daniel2024 Profile Picture
    on at

    hi,

    I prefer to set a schedule every hour that should collect all the new files created on the specific folder and send the notification by email 

     

    the main target is to create an "interface error files alert email" that will advise regarding the new files created in the specific folder (error folder).

    but since i'm new on this area, i started to create a "simple" job/flow

    thanks !

  • v-yetonggu-msft Profile Picture
    on at

    vyetonggumsft_1-1716189905898.png

    addHours(utcNow(),-1,'yyyy-MM-ddTHH:mm:ssZ')

    vyetonggumsft_2-1716189937901.png

    Best Regards,

    Sunshine Gu

     

  • Daniel2024 Profile Picture
    on at

    i follow your guide but i get this error in the second stage:

    Daniel2024_0-1716196542261.png

    can you please explain what the problem is here? thanks

  • v-yetonggu-msft Profile Picture
    on at

    Hi @Daniel2024 ï¼Œ

    If you just want to send an email, take a look at this test:

    For files created in the previous hour, we use the Apply to each control to cycle through the names and contents of those files, append them to an array variable, and send them in an email:

    vyetonggumsft_2-1716196600699.png

    Created gt '@{addHours(utcNow(),-1,'yyyy-MM-ddTHH:mm:ssZ')}'

    vyetonggumsft_3-1716196661313.png

    {
    "Name":@{items('Apply_to_each')?['{FilenameWithExtension}']},
    "ContentBytes":@{body('Get_file_content')}
    }

    Best Regards,

    Sunshine Gu

  • v-yetonggu-msft Profile Picture
    on at

    Hi @Daniel2024 ï¼Œ

    Show me a screenshot of the configuration parameters in your Filter Query.

    I used this expression flow in Filter Query without getting an error.

    My Flow Run Successful:

    vyetonggumsft_0-1716197794963.png

    Best Regards,

    Sunshine Gu

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

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard