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 / Having Problems with n...
Power Automate
Unanswered

Having Problems with null values Error :Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'contains' expects its first argument 'collection' to be a dictionary (object), an array or a string.

(0) ShareShare
ReportReport
Posted on by 4

Hi everyone, 

I was recently tasked with creating a flow that will pull attachments from an outlook mailbox and place them in folders based on who the email was sent to or who was cced on the email. The flow works fine when I put my email in or anyone of my emails, but as soon as I put in one of my coworkers emails I get a null value. Any reason this would be and are there any known solutions. Attached is a basic picture of my flow. The full error message is Unable to process template language expressions for action 'Condition_1' at line '0' and column '0': 'The template language function 'contains' expects its first argument 'collection' to be a dictionary (object), an array or a string. The provided value is of type 'Null'.'.  Thank you

basicflow.PNG
Categories:
I have the same question (0)
  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Hi @gadama 
    Could you explain this a little more?

    DJ_Jamba_0-1709985776253.png


    I don't think you can have as a condition:
          'To' field contains nothing
    ...when setting criteria for emails.

    I don't think the flow will even reach the second group in the condition, but even if it did, the screenshot above is basically saying:
    Filter emails where nothing is in To and CC AND filter those emails where something is in To and CC and that criteria can never be true.

     

    The other thing I'm confused on is - the flow can only run in the context of your email account. The only way it can check your colleagues email accounts is if they all have a copy of this flow and those flows are configured under their account.

  • Ellis Karim Profile Picture
    11,940 Super User 2026 Season 1 on at

    Hi @gadama ,

     

    As @DJ_Jamba has mentioned, the condition will never evaluate to true.

     

    For the condition at least, you could try ordering the conditions as as shown below to see if it stops the flow from stopping with an error:

    Snag_4c07370.png

     

    Then look to address the questions raised by  @DJ_Jamba .


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site

  • gadama Profile Picture
    4 on at

    The to and cc fields are both filled out with company emails that i wasnt going to post to a public forum. When it is my email it works fine but when I put theirs in it stops working thinking maybe encryption?

  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Hi @gadama 

     

    Can you throw up another screenshot and just make up the data that you omitted from your first screenshot?
    e.g.

    bob@bob.com
    may@may.com

    etc

  • gadama Profile Picture
    4 on at

    yes attached are some screenshots without the null values when the flow was working which makes me think it could be encryption. The create file section of the email assigns the email to a folder based on who it is sent to as shown example email would go in the example folder example 1 would go in example 1 and so on.  When including the condition with the null values it now does not pull any of the attachments.

    flow help.PNG
    example 2 flow checker.PNG
    create file.PNG
  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    OK so first things first.
    In order for any of your conditions to work, there has to be at least two emails in the To or CC fields.
    Your flow runs in the context of your mailbox.
    Can there ever be more than one email address in the To or CC fields? Because if there can only be one - it will always be your own email address. Checking for others is pointless

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 283

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard