cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
manfredg
Helper I
Helper I

Cannot enter a sender email adress in on new mail trigger

I want to enter a sender email adress in the trigger - see below 

It does not recognize any valid email adress and after saving it is gone away - the thing worked before perfectly with three other flows 

manfredg_0-1641916174151.png

thanks for help 

1 ACCEPTED SOLUTION

Accepted Solutions
VictorIvanidze
Community Champion
Community Champion

Hi @manfredg,

 

this trigger condition works fine for me:

@contains(createArray('address1@contoso.com','address2@contoso.com'),triggerOutputs()?['body/from'])  

 

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

View solution in original post

25 REPLIES 25
bcione
Regular Visitor

I am also having a similar issue. I created a cloud flow to save emails when a new email arrives from specific emails (to include attachments). The flow works seamlessly with internal emails, but once i add external emails, the emails dont stay in the flow, they disappear after saving. Any idea what the disconnect is? or if it is true that the emails have to be connected to a 365 account, aka cannot use gmail emails? 

Ramspevi
Helper I
Helper I

@manfredg 

Had the same problem with a lot of my flows. 
My solution was: 

- Add compose action 
- Write the external E-Mail Adress there 
- reference the output of this compose action wherever you want.

Hope this helps

bcione
Regular Visitor

does the compose action go after the trigger? that did not work for me unfortunately 😞 

Ramspevi
Helper I
Helper I

I am sorry. I misread the question. 

For a trigger that wont work. What you can do is change the trigger condition. 

1. Click on the trigger 

2. Settings (on the bottom of the settings are the trigger conditions)

3. Set the trigger condition to the email you want

 

If you are having problems with the syntax of the trigger conditions use the Filter array action. I attached you a picture.

TA.jpg

manfredg
Helper I
Helper I

Hello Ramspevi !

 

thank you for the nice solution - the problem is, that the trigger is allways executed - what i do not understand is the fact that the trigger works well with a valid email adress in three flows and now i cannot write a similar flow - I allways use the standard template - it seems thatthe trigger changed - why ????? that drives me crazy

A check of the email adress i can also do in a condition after the trigger - or not ?? 

 

 

If you set trigger conditions to your Email trigger, the flow will only execute if those trigger conditions match. 
Of course. You can set a condition after the trigger that filter the incoming 'trigger matching emails' but working with trigger conditions is - most of the times - the better solution. 


manfredg
Helper I
Helper I

I fixed it now by exporting - editing the definitions JSON and Import 

A complicate solution but it works 

manfredg
Helper I
Helper I

It works perfectly with one sender email adress - if I want to enter a second or a third one they are always removed - even with the JSON editor - it seems i do not understand the syntax 

Screenshot 2022-01-15 155028.jpg 

VictorIvanidze
Community Champion
Community Champion

Just use the trigger conditions.

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.
manfredg
Helper I
Helper I

does not work - maybe because of the fact that i cannot choose the right array 

manfredg_0-1642337797383.png

 

to be more precise: 

1. it only works if the from: field is empty 

2. it works with one e-mail adress but not with two - is it maybe possible that there is an AND  instead of an OR

first condition

@equals(triggerOutputs()?['body/from'], 'first.adress@hotmail.com')

second condition

@equals(triggerOutputs()?['body/from'], 'second.adresss@hotmail.com') 

 

rgds,

Manfred

manfredg
Helper I
Helper I

and setting an or before did not help - syntax seem to clean but it is not executed the way i want it 

here the condition

@OR(equals(triggerOutputs()?['body/from'], 'adress1@hotmail.com'), equals(triggerOutputs()?['body/from'], 'adress2@gmail.com'))

VictorIvanidze
Community Champion
Community Champion

Try this:

@contains(triggerOutputs()?['body/from'], 'first.adress@hotmail.com,second.address@hotmail.com')

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.
manfredg
Helper I
Helper I

thank you Victor for the tip 

does not work 

the basic problem is, that my Cobol and Fortran know how from the 90's does not help 😉 

manfredg
Helper I
Helper I

another try: entering more than one email adress in the JSON definition file

**************

"fetch": {
"queries": {
"folderPath": "Inbox",
"to": "office@american-iron-vienna.at",
"from": "adress1@gmailt.com;adress2@hotmail.com",
"importance": "Any",
"fetchOnlyWithAttachment": true,
"includeAttachments": true,
"subjectFilter": "Invoice"

**************************

than you see in the display both email adresses but not separated with semicolon and each adress is stored in a separate line 

 

and now no idea anymore 

I want to run the flow if a mail comes from one of let's say 10 email adresses - nothing else 

the alternatve is to create a flow for each vendor sending invoices 

 

 

bcione
Regular Visitor

Thank you for the solid attempts at trying to remedy our issues. I am starting to think its an internal issue and our company has certain domains blocked. Our IT department is looking into that as the issue. In the interim, still looking for any other potential remedies.

 

Thank you! 

manfredg
Helper I
Helper I

OK - maybe it helps when i write what I need:

 

I want that if a mail arrives from external mailsender 1 or external mailsender 2 (or 3 or 4) and the subject contains the word Invoice OR the word Rechnung then the trigger should start and save the attachment (it would be nice only the PDF - no images from the html text or other attachment formats - but thats a nice goody) into a  specific folder in onedrive. 

 

Other requiremnt like renaming the file with the two first letters of the domain as prefix I managed myself in the meantime. It seems that the trigger "on new email V3" provided  by the power automate system does not work like documented. 

 

In the meantime i create a flow for each vendor sending invoices - but that's not productive.

 

regards,

Manfred   

bcione
Regular Visitor

what solution above worked for your flow with an external email? the original flow or any of the potential suggestions? 

no solution worked with one than more e-mail sender 

for one email sender i had to enter the external e-mail adress by hand into the defintions.json 

only my own e-mail adress (the tenant owner - the tenant has only one user) worked in the application - i tooked the following template: 

Office 365-E-Mail-Anlagen in angegebenem OneDrive for Business-Ordner speichern | Microsoft Power Au... as starting point of my work 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,668)