cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
edgonzales
Super User II
Super User II

@Anonymous 

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.

Anonymous
Not applicable

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

Anonymous
Not applicable

@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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (2,450)