Skip to main content
Community site session details

Community site session details

Session Id : oM15CjF8WkWM4Gfh68/V1Z
Power Automate - Building Flows
Answered

Trigger : when a specific OneDrive file is modified

Like (0) ShareShare
ReportReport
Posted on 22 Sep 2023 08:47:09 by 22

Hello,

 

I'm trying to build a flux which will update a power BI dataset when a specific excel file (named "labellisation.xlsx") is modified in my one drive

 

The Trigger I added is "when a file is modified" from One Drive. I selected the correct folder and now when I modified any file in it my power BI is updated

 

Now I want to add a condition so the trigger works only if its "labellisation.xlsx" that is modified

 

I try using the same condition as the one I use when I use the "When an item or a file is modified" trigger from sharepoint : @contains(triggerOutputs()?['body/{FilenameWithExtension}'], 'labellisation')

 

But this condition does not work. I guess the condition syntax is not the same for a one drive trigger and a sharepoint trigger but I couldn't find the correct one

  • DB-10091421-0 Profile Picture
    22 on 25 Sep 2023 at 07:16:32
    Re: Trigger : when a specific OneDrive file is modified

    It works with 

    @equals(base64tostring(triggerOutputs()?['headers/x-ms-file-name-encoded']), 'Labellisation.xlsx')

    So my problem is solved, thanks for your help

    But not with (error message : One or more fields provided is of type 'Null', a different type is expected.)

    @contains(base64tostring(triggerOutputs()?['headers/x-ms-file-name-encoded']), 'Labellisation')

     

  • Verified answer
    Michael E. Gernaey Profile Picture
    45,440 Super User 2025 Season 2 on 22 Sep 2023 at 16:03:25
    Re: Trigger : when a specific OneDrive file is modified

    Hi,

     

    Please try this

     

    You can do either of this

     

     

    @contains(base64tostring(triggerOutputs()?['headers/x-ms-file-name-encoded']), 'labellisation')
    
    @equals(base64tostring(triggerOutputs()?['headers/x-ms-file-name-encoded']), 'labellisation.xlsx')

     

     

    Please note if you try to "test" it manually it will fail and say your have a null string which is true because there was no passed in filename yet.

     

    So save it, then make a change and then look in the history to validate. 


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2