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

Flow Condition Works with Raw Text String, but Not With Compose Outputs or Variables

(0) ShareShare
ReportReport
Posted on by 8
I have a flow that is triggered by an email.
 
The email is in Plain Text with a simple text string.
 
I've tried using a Compose element to grab the text from the email, and it does grab the exact correct text.
I've also tried a Variable, getting the exact correct text.
 
Later I get all the files from a remote computer (File System), and it does get the 2 test files perfectly and the names of the files are exactly matching the text from the email, they simply have different extensions.
 
In an Apply to each loop, with a Condition of File Name | Contains | <outputs of Compose or Variable> the result is false.
However, using the exact same text string, but raw in the Condition - the result is true.
 
I have double, and triple, at this point probably checked the outputs of variables and composes I've used - they always match the text string perfectly.
- But when using a Compose or Variable output, the result is false.
 
It's the same exact text string!
I have the same question (0)
  • BJ-09110032-0 Profile Picture
    8 on at
    Flow Condition Works with Raw Text String, but Not With Compose Outputs or Variables
    I have even removed the 2nd file from the remote computer, and when using Compose or Variable to grab the text from the email, and using those outputs in the Condition, the result is always false. But when using the exact same text in raw in the Condition, the result is true.
     
    I need this to work as the trigger (email) will be coming in with different file names, so I need the flow to dynamically find the correct files based on the text in the email.
     
    Does anyone have any idea on how to get this to work?
  • CU08111613-0 Profile Picture
    14 on at
    Flow Condition Works with Raw Text String, but Not With Compose Outputs or Variables
    try using:
    trim(outputs('Compose'))

    string(outputs('Compose'))


    Use replace() function to remove special characters or convert it to a standard format
    replace(outputs('Compose'), char(160), ' ')


     
    For debugging the condition:
    Use the "Compose" action to output both the file name and the Compose/Variable values used in the Condition.
    Manually compare the outputs to ensure that there are no subtle differences (such as additional spaces, different capitalization, or unexpected characters)


    trim(outputs('Compose_or_Variable'))
    Use this trimmed value in your Apply to Each condition




    You could also write a custom expression in the Condition instead of using the standard UI interface for conditions:
    contains(toLower(item()?['FileName']), toLower(trim(outputs('Compose'))))


    I hope by doing the above you will be able to determine why the comparison is evaluating to false when using Compose/Variable values and resolve the issue effectively
     
  • Expiscornovus Profile Picture
    32,934 Most Valuable Professional on at
    Flow Condition Works with Raw Text String, but Not With Compose Outputs or Variables
    Did you try an expression in your condition? If so, did you use the below?
    outputs('Compose')
    Btw, a screenshot of the flow setup would also help with the troubleshooting, can you share this?
  • BJ-09110032-0 Profile Picture
    8 on at
    Flow Condition Works with Raw Text String, but Not With Compose Outputs or Variables
    @Expiscornovus
     
    Yes, I have tried using an expression, rather than selecting from the dynamic content. Although it's ultimately doing the same thing anyway.
     
    I will try to attach screenshots.
     
  • BJ-09110032-0 Profile Picture
    8 on at
    Flow Condition Works with Raw Text String, but Not With Compose Outputs or Variables
    It's a very simple flow - here are screenshots.
     
     
     
     
     
  • BJ-09110032-0 Profile Picture
    8 on at
    Flow Condition Works with Raw Text String, but Not With Compose Outputs or Variables
    CU0811613-0 - this solved the issue.
     
    Added a 2nd 'Compose' with "trim(outputs('Compose'))", then using the 2nd Compose/Outputs in the Apply to Each -> Condition.
     
    There must have been some extra unseen characters.
     
    I was able to then use a 'Get file metadata' and 'Copy file' to successfully copy the files to another directory on the remote computer.

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

#2
Tomac Profile Picture

Tomac 388 Moderator

#3
chiaraalina Profile Picture

chiaraalina 264

Last 30 days Overall leaderboard