cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FBayer
Regular Visitor

Getting usable data for Condition from Outlook 365 email arrives (V3) trigger

This is my first time creating a Flow, so my apologies if I'm just being stupid.

Here's what I'm trying to do: When an e-mail arrives in my inbox from otherteam-area1@mycompany.comotherteam-area2@mycompany.com, etc., I want to automatically forward this to myteam-area1@mycompany.commyteam-area2@mycompany.com etc unless myteam-areaX@mycompany.com is already in the "To" or "CC" field of that e-mail.

To get started I decided to first do it for just one area, and then figure out how to have it work for each area. (Worst comes to worst, I guess I could just create 12 different flows for the 12 different areas, I guess.) However, it's not even working for the 1 area the way I've set it up, which is as follows:

 

  1. Trigger: Outlook 365 "When a new email arrives (V3)" where From=otherteam-area1@mycompany.com
  2. Initialize variable myteam-area1 as String value myteam-area1@mycompany.com
  3. Condition: AND
    1. To (from Trigger) does not contain myteam-area1
    2. CC (from Trigger) does not contain myteam-area1

 

This creates the following error when run:

Unable to process template language expressions for action 'Condition' at line '1' and column '19537': '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'.'.

This suggests that the To and CC fields from the trigger have a data type of 'Null' rather than 'dictionary', 'array', or 'string'.

So is there a way to transform these fields into an array or string that the Condition can use? Or, if not, is there a different trigger I should use?

1 ACCEPTED SOLUTION

Accepted Solutions
FBayer
Regular Visitor

Figured it out: The fields from the trigger also need to be initialized as variables. Not very intuitive or user-friendly, but hey, it works!

View solution in original post

1 REPLY 1
FBayer
Regular Visitor

Figured it out: The fields from the trigger also need to be initialized as variables. Not very intuitive or user-friendly, but hey, it works!

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (1,375)