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

Searching e-mail subject for several strings

Okay, I'll be honest here-- not sure how to write this one. I need to search an e-mail subject for three distinct pieces of data. The e-mail subject will contain something like:

Item1: ABC, Item2: DEF, Item3: GHI

 

I need to watch a Shared Inbox for new e-mails. When one arrives, I need to pieces of data parsed out from the values of Item1, Item2, Item3, if you will and then spit it out to some Teams messages if the values contain certain information. I have the Teams messages and such figured out from previous Flows. Just not sure how I can go about getting the pieces of information. I know how to search for one, but don't know how different it is. Thoughts are appreciated!

 

The Teams message will need to read something like this:

 

Item1: ABC

Item2: DEF

Item3: GHI

Sorry for the question with no display of attempts-- I usually have a starting base. I'm probably overthinking it.

1 ACCEPTED SOLUTION

Accepted Solutions

ok, so here's what I did:

split(replace(outputs('SampleData'),' ',''),',')
 
So, first this gets rid of any spaces, then it splits the string into an array on the comma.  You can either use a Compose action with that expression, and then set an Array variable to the output, or drop that expression in the Value part of the Initialize variable.
 
From there, you can probably run a normal condition and do the things you've already done.
 
Keep us posted.
 
-Ed-
 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

4 REPLIES 4
Super User II
Super User II

@jbuis 

Hi there. A couple of questions before we dig in...

  • Will the subject always have three items?
  • Will they always be separated by a colon? ':'
  • Will the criteria you mentioned apply to ALL three items?  Or will there be a criteria for Item 1, a different criteria for item 2, and so on?
  • What happens if some of the items meet the criteria, but one or two don't?

Check out the Split() function, as I think that will be helpful in parsing out the subject if the data is consistent.  Here's a video:

 

Hope that helps.  Keep us posted.

-Ed-

 

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Thank you for the reply! The three items will always be in the subject and will always be listed like this: Item1: variable, Item2: variable2, Item3: variable3

 

Split is what I have used previously for a single item. Thanks again!!

ok, so here's what I did:

split(replace(outputs('SampleData'),' ',''),',')
 
So, first this gets rid of any spaces, then it splits the string into an array on the comma.  You can either use a Compose action with that expression, and then set an Array variable to the output, or drop that expression in the Value part of the Initialize variable.
 
From there, you can probably run a normal condition and do the things you've already done.
 
Keep us posted.
 
-Ed-
 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

@edgonzales You're a freaking genius. I will take this and run with it. I will probably further it with getting the [0], [1], [2] pieces out it as some new requirements rolled my way. This gets me exactly where I need to be to think through the rest of the solution. Thanks every so much, mate! Cheers!!!!!

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (7,703)