cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nsgma
Helper II
Helper II

Indexof and subtring returns the Expression is Invalid

I have a flow when an email message is flagged sends an email using "FROM" in the subject. Something like "FROM"'s message was flagged". The "FROM" always returns a e-mail address "name.surname@domain.com" I though I could easily shorten it by using Substring("FROM", 1, indexOf("FROM","@")) but some how it is not that simple and I have no idea why it is returning an Expression is invalid.

When I insert the "FROM"on the expression it gets automatically transformed in "triggerOutputs()?['body/from']"

substring(triggerOutputs()?['body/from'],1,indexOf(triggerOutputs()?['body/from'],"."))

 

What am i doing wrong?

N

1 ACCEPTED SOLUTION

Accepted Solutions
ccc333ab
Solution Sage
Solution Sage

You will need to use single quotes, you have double quotes around your @. 

View solution in original post

4 REPLIES 4
ccc333ab
Solution Sage
Solution Sage

It would be best if you could post a screenshot of your flow...

Screenshot 2021-07-03 030544.png

ccc333ab
Solution Sage
Solution Sage

You will need to use single quotes, you have double quotes around your @. 

nsgma
Helper II
Helper II

Oops. Beginner's mistake. Thanks!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,892)