Skip to main content

Notifications

Power Automate - General Discussion
Answered

Index Of expression l To get company name from sender's email

(0) ShareShare
ReportReport
Posted on by 26

Hi!

 

I would like to get company name from the sender's mail. I've been using 'indexOf' expression, but it is giving me a number as result, instead of the name. By any chance, is there any other expression I can use?

 

Example:

-Email: flor.flores@random.com

-Expected result: random

-Result: 11

 

Any help would be greatly appreciated

Thank you, best regards!

 

My flow:

KorinaHdz24_6-1717533746558.png

 

KorinaHdz24_0-1717533544816.png

 

KorinaHdz24_2-1717533558859.png

 

KorinaHdz24_3-1717533572478.png

 

KorinaHdz24_4-1717533586786.png

Expression: sub(outputs('Last_IndexOF_(Compose)'),outputs('IndexOF_(Compose)'))

 

KorinaHdz24_5-1717533596906.png

Expression: substring(variables('varTexto'),outputs('IndexOF_(Compose)'),outputs('Characters_number_(Compose)'))

  • Chriddle Profile Picture
    Chriddle 7,289 on at
    Re: Index Of expression l To get company name from sender's email

    Email addresses are tricky 😉 

     

    Some issues that you might encounter:

     

    Address with subdomains:

     

    jim@salesdepartment.example.com
    jim@example.co.uk

     

     Do you want the 2nd level domain or the 3rd level?

     

    Address with IP:

     

    jim@[192.168.2.1]

     

    Fortunately, this does not happen often.

     

    Address with International domain name (->Punycode)
    I have no experience with this, but it looks like a lot of fun🤣

     

    And many more

     

    What I'm trying to say is: don't always expect to get the result you want.

  • Verified answer
    SudeepGhatakNZ Profile Picture
    SudeepGhatakNZ 14,231 on at
    Re: Index Of expression l To get company name from sender's email

    @KorinaHdz24 

    Use this expression

    first(split(last(split(variables('MyString'),'@')),'.'))
     

    SudeepGhatakNZ_0-1717537333062.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard