Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Checking email sender against SharePoint list

(0) ShareShare
ReportReport
Posted on by 4

Hi, I am trying to create a flow that will check if the sender of an email matches any entries SharePoint list of email addresses and domains.

 

I am having trouble with the Apply to Each element, running this:

 

lightspy28_1-1611884258932.png

 

Give me the error:

 

Unable to process template language expressions for action 'Condition_2' at line '1' and column '29386': 'The template language function 'contains' expects parameters of matching types: a dictionary and a key (string), an array and a value (object), or a string and a substring. The provided types 'String' and 'Object' are incompatible. Please see https://aka.ms/logicexpressions#contains for usage details.'.

 

ActionFailed. An action failed. No dependent actions succeeded.

 

 

This method below runs, but always triggers "No", despite the email address being on the list.

 

lightspy28_0-1611884007201.png

 

I must be missing something in how the "Apply to Each" function works with SharePoint lists...help!

  • lightspy28 Profile Picture
    4 on at
    Re: Checking email sender against SharePoint list

    Thank you, that did shed some light on the issue.  The second screenshot was actually working properly, but my logic was incorrect in that I forgot it was really applying to each entry in the List, so each time an entry didnt match the From address, it would trigger a No.  I changed the apply to each instead increment a variable, and then perform a standalone action based on the condition of the variable.

     

    Thanks!

  • Verified answer
    Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Checking email sender against SharePoint list

    @lightspy28 

    I suggest for troubleshooting is inside your apply for each loop , add to compose data operations , one add to it the Title and the other one the From, You can then check flow history to understand what is going on.

     

     

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

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!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1