cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
karlh
Level: Powered On

extracting parts of email address for planner

I made a flow that creates a planner task from an email and I would like to have parts of the email address in my task title.

 

wegewgewg.PNG

For example, this is the email address: "name@whatever.com"

Currently my Task title would look like this: "name@whatever.com: Subject"

But I'd like it to look like this: "name: Subject"

 

Any ideas on how I could do that?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: extracting parts of email address for planner

Hi @karlh 

 

Just change the From with this expression:Flow 1.jpg                                                                                         \/

Flow 3.jpg

 

Where the expression is

first(split(triggerBody()?['From'],'@'))

And see the magic.

 

Happy Flowing!


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


4 REPLIES 4
Super User
Super User

Re: extracting parts of email address for planner

Hi!

 

Step1 : You can create a new variable of type integer (let us name it as test) and assign it with the expression : 

indexOf(body('Get_email')?['From'], '@')
Step2 : Create another variable of type string and assign it with the expression : 
substring(body('Get_email')?['From'],0,variables('test'))
 
you can put the step 2 directly in the planner title as an expression input. 
 
Please mark this as a solution if it helps you/ answered your question. 
 
karlh
Level: Powered On

Re: extracting parts of email address for planner

Thank you for your response!

 

dfhdfhdfh.PNG

 

It says: "The template validation failed: 'The action(s) 'Get_email' referenced by 'inputs' in action 'Initialize_variable' are not defined in the template.'."

 

How do I know the correct termination for "when a new email arrives"?

{
    "inputs": {
        "host": {
            "connection": {
                "name": "@parameters('$connections')['shared_office365']['connectionId']"
            }
        },
        "method": "get",
        "path": "/Mail/OnNewEmail",
        "queries": {
            "folderPath": "Inbox",
            "importance": "Any",
            "fetchOnlyWithAttachment": true,
            "includeAttachments": true
        },
        "authentication": "@parameters('$authentication')"
    },
    "recurrence": {
        "interval": 5,
        "frequency": "Minute"
    },
    "metadata": {
        "flowSystemMetadata": {
            "swaggerOperationId": "OnNewEmail"
        }
    },
    "splitOn": "@triggerBody()?['value']"
}

 

Super User
Super User

Re: extracting parts of email address for planner

Hi @karlh 

 

Just change the From with this expression:Flow 1.jpg                                                                                         \/

Flow 3.jpg

 

Where the expression is

first(split(triggerBody()?['From'],'@'))

And see the magic.

 

Happy Flowing!


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


karlh
Level: Powered On

Re: extracting parts of email address for planner


@gamoraes wrote:

Hi @karlh 

 

Just change the From with this expression:Flow 1.jpg                                                                                         \/

Flow 3.jpg

 

Where the expression is

first(split(triggerBody()?['From'],'@'))

And see the magic.

 

Happy Flowing!


Thank you so much! Smiley Happy it did the trick

Helpful resources

Announcements
firstImage

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 168 members 5,183 guests
Please welcome our newest community members: