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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Contain condition alwa...
Power Automate
Answered

Contain condition always false

(0) ShareShare
ReportReport
Posted on by 4

Hello!

 

I know there is a lot of similar questions withing the topic, but none of solutions seems working to me. So, the problem is that the "contain" condition always claiming "False" when trying to copy a a file matching the condition from one share-point site to another. Here is a screenshot (sorry for the russian interface, but hope the meaning is clear)image.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

My condition is: @contains(triggerOutputs()['headers']['x-ms-file-name-encoded'], 'Summary').

 

Thanks for any help!

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @pbobyrev,

     

    Do you want to check if the file name of the new created file contains 'Summary'?

    Do you create your flow using the "Copy files from one SharePoint Online account or folder to another" built-in template?

     

    I think there is something issue with the trigger within your flow. The File name dynamic content the "When a file is created" trigger returned is the base64 representation of the file name rather than the file name. The screenshot as below:21.JPG

     

    I have made a test on my side and please take a try with the following workaround:

    • Add a "When a file is created (properties only)" trigger, specify Site Address and Library Name.
    • Add a Condition, left input box set to File name with extension dynamic content of the trigger, right input box set to Summary, middle drop down, choose contains.

             or you could click "Edit in advanced mode", type the following formula:

    @contains(triggerBody()?['{FilenameWithExtension}'], 'Summary')
    • Within "If/yes" branch of Condition, add a "Get file content" action, specify Site Address, File Identifier field set to Identifier dynamic content of the trigger.

             Add a "Create file" action, specify Site Address (Another SharePoint Site) and Folder Path, File Name field set to File name with extension dynamic content of the trigger, File Content field set to File Content dynamic content of the "Get file content" action.

     

    Image reference:22.JPG

    The flow works successfully as below:23.JPG

     

    Best regards,

    Kris

     

     

  • pbobyrev Profile Picture
    4 on at

    Thank you, Kris!

     

    It works!

  • paula_flaherty Profile Picture
    6 on at
  • Crimsonhobbit Profile Picture
    2 on at

    This solution doesn't apply now that 'Edit in Advanced Mode' is no longer available.

    I'm trying to send an email when a file is added or modified in a sharepoint folder. The Flow builder makes this look like a piece of cake and it should be but no matter how I try to do this the result is always False.

    If I hover over the condition File name box I can see it's looking for x-ms-file-name-encoded rather than x-ms-file-name. If I replace the left box with the edited code to remove '-encoded', it still doesn't work.

    Is there another way of achieving this ?

     

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard