Extract email address using Power Automate

Step two:

Now we open Power Automate (https://emea.flow.microsoft.com) and create a flow as follows

Under Create -> Automated Flow
After that we go to skip

Now we create a new flow:

First we select as trigger -> When a new email arrives (V3)
And in the Subject Filter section, enter the term we want to filter in the email to select the right mails. In our case we choose the header from the Activity Alert from the Protection Center “Power BI Report”

Next we select Html to text and choose Body from the menu.

Now we choose the step Compose and insert the following function in the expression:
The expression counts the characters in the body and returns them.

Then we choose Compose again and this time we enter the following function:
add(indexOf(body('Html_to_text'), 'User'),9)
This function goes in the body up to the user and counts 9 characters from there on, exactly to the : after user.

Also in this step we need again Compose and a function that looks like this:
indexOf(body('Html_to_text'), 'Element')
This function goes in the body up to the word element.

Now we need Compose the last time in our flow. The function we have here is as follows: substring(body('Html_to_text'),outputs('Compose_2')),sub(outputs('Compose_3'),outputs('Compose_2'))
This function now combines the Compose function 2 + 3 and we get the email address that is enclosed between the user and the element.

In the last step of our flow we use Send email (V2) here we take the generated output from Compose 4 and set it as recipient in the To field. Finally we enter all information the recipient of the mail needs.

Dieser Beitrag wurde unter Allgemein, Governance, Power Automate, Power BI veröffentlicht. Setze ein Lesezeichen auf den Permalink.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert