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

How to parse E-Mail Data for several variables

Hi there,

 

I need to set up a flow for parsing information from the SAP Fiori e-mail notification for further workflow operations.

The Ui5 is sending an e-mail to me of which contains every-time the same Item groups but with different languages (German/english).

 

Looks like:

 

subject mail: version 1: Neue Meldung 2: New Notification

body mail: version 1: Meldender version 2: Reported by, etc…

 

First I set up the „when a new mail arrives (v3)“ with send by“ (e-mail of notifier) which then goes to a apply to each on subject and another for the body.

 

I thought to do a content conversion and then use the item function in compose action to the get variables for each German/English Mailform informations - but I can‘t get any information with that - it still crashes.

 

So could anybody give me a hint or how to to get this Information parsing me the data?

 

Most times notifier is sending me German information for which I have a working flow - but things getting more different with additional notifications in English and I just get stucked.

 

Thanks in advance 

26 REPLIES 26

Hey,

 

if you post screenshots of the flow that you have and of the errors you're encountering, we can give you pointers.

Parsing the string is a good idea.

What you can do is string split if the email has a specific structure. Then put the different elements into compose actions and then use the content as you see fit.
You can use longer strings as condiction where to split. Just take it one step at a time and don't try to do everything at once.

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.

What @schwibach said on the screenshots, and if you ensure to embed the screen shots of the design view of your flow so that they are visible on the screen using the photo button, then more people will see them, too. Because some folks cannot download attached files. 👍

 

Thinking Aloud

You may wish to see if the HTML has 'data' attributes for the information that you are after.

 

Any software / developer worth their salt will encode values into the HTML code, so that people can more easily sift it for actual data. It's possible (but not probable) that this is happening with your mails. 🙂

So for the Mail Form of the UI5 the letter direction is same on both languages.

 

From: ui5notif@onmicrosoft.gor

to: my@mailboxcompany.com

 

Subject: 1. Neue Meldung: 12345678 (mem) Wasserleitung verstopft

              2. New Notification: 12345678 (mem) PRIO Alarm Pump M01

Body: Meldender:

          UserID:

 ...

 

or

 

          Reported by:

          UserID

...

For "..." the following names before ":" are same in every notification, content behind ":" is dynamic

 

Basically the UI5 notifies in both languages, but not for each Alert e.g. each notification represents 1 alarm and this could be presented in german OR english. So the flow should respect the given language in which the alert is notified and operate the data according to language because for the split patterns german/english has different spaces in between the data. 

 

So with the data from the mail, the given information then goes to a sharepoint table or excel sheet with add a new row.

 

For some cases if the priority of the notification is High, the data will also be send by e-mail to my alerting service.

 

In the given Data of body are two to three dynamiclay addable information.

 

I startet the flow with "when a new mail arrives (v3)"

then I do a html2text for further proceeding. But I thought how about if it would be possible to directly array the body of the Subject & Mail and then fill the dynamic content but I guess I miss something, to do this correctly. 

 

The html2text is the right way to go if the data isn't encoded as @eliotcole suggested it might.

 

Then I would recommend you do a condition on whether the body contains "Neue Meldung"... Then you know whether it's in German or in English.

 

Then you deal with the English version and the string splits and in the other path of the condition with the German version.

You could initialise variables for each field that you need directly after the trigger and then set the variables in each path of the condition. Initially set the variables to some string that you will recognise as not having been changed such as "TestUserID" 

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.

I have tried the way with condition and switch - but I can´t get the Information proceeded.

My Flow is actual:

Trigger: When a new Mail arrives (V3):

Bild 28.01.24 um 11.39.jpeg

Bild 28.01.24 um 11.40.jpeg

Bild 28.01.24 um 11.41.jpeg

The confusing thing on that is also, that if I apply the html2text conversation with the body of the E-Mail Data will automatically do the loop and from that loop I don´t get the information further in this flow nor it will trigger an condition or switch.

 

In an other try I had done the Conversations in the main path, but don´t know, why this happen and the Data would not proceed.

Was thinking of a possibility to write the Data each in an Variable for use it different in the following flow, but I really get stucked right at the Moment for that I can´t see the point, why the flow has this behaviour.

 

Because of the trigger in the subject the flow should decide if it should proceed in german or to switch in english and then parse the mail accordingly. Parsed Innformation the get stored in a sharepoint and for Priority will send via E-Mail to the alarm Provider too.

But what do I missing?

 

 

You don't need all these loops.

Start with a simple compose action for you subject and an html2text for the body.

 

schwibach_0-1706439591658.png

 

You can copy this into the compose action

@{triggerOutputs()?['body/subject']}

 

and this into the html2text

@{triggerOutputs()?['body/body']}

 

Once you have the text, we'll do the next step.

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.

I have tried build the flow as shown:

Bild 28.01.24 um 12.40.jpeg

 

 Added the time stamp for later data in the workflow, and then the next step:

Bild 28.01.24 um 12.41.jpeg

 

and when I hit the apply/OK button, I get this error:

 

Bild 28.01.24 um 12.41 (1).jpeg

 it will not apply the trigger out... and I don´t see, why this will happen. Looks like the trigger won´t output anything, but it does. So why this error occour - I don´t know 

Now the steps Compose = MailSubject:

 

748AB2DB-BA84-477F-B965-F165D0DAA1C8.jpeg

 

Test -> successful & then the htm2ltext for the mail body:

 

Bild 28.01.24 um 12.58.jpeg

 

With that, I get no Data so I reduced body/ in the conversation as followed:

80EE7A61-40D4-428E-AE9C-E42222609D74.jpegTested the flow and the subject is right in the compose action and the notification mailtext is in the html2text conversation with the correct data.

 

So for so far as I see, the data must be first processed to gather information this Notification is in english or german - most notifications are in german, but some don´t. So the spaces for further split actions e.g. space inbetween "Neue Meldung" and "New Notification" so that in the following part of the flow first condition check hit the right path of the flow to reduce the possibility of incorrect data I was also asking myself, if by using it in a condition und with only two languages in possibility, a switch could do the job instead of a condition better?

 

In a condition I will do the german part in the "NO" Path and in the "YES" path I do the english part.

But in the first run I had done the conditions in the Order german and english and only go to YES do the Data parse in this step - this by know had has collided painfully and have not worked.

 

So far as I see the description the Switch is same like condition, so I thought I do the activation of english by the subject and go there the path... but also don´t work 😞 

 

Any Suggestions? 

Now the flow with further Proceeding and parse Mail Information for the next Step of gather the information is it german or english:

Bild 28.01.24 um 13.34.jpeg

Until this step, all information was parsed in the flow from the hited trigger and for the decision of the provided language: use a condition here or a switch for fast and smooth data parsing? 

Can you post the results of a successful run?

It's important to see the content of the flow steps and then design the following steps accordingly.

What you'll want as a next step is Condition (in German: Bedingung) where we will check if the Subject contains (enthält) "Neue Meldung:"
Put a Compose action in both paths and run the flow to see if that part works.... Then you're ready to take the next step. 

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.

The Successful flow until now:

00B8D7DD-992A-410E-9B86-F7AA493890A5.jpeg

 

E02BE144-682A-49F3-BC3B-304AA2D5909B_4_5005_c.jpeg

 

Then Save & do a test Run:

 

067C4968-B845-4998-B2B6-3B25B43644E4.jpeg

with the provided parse:

 

In the "MailSubject" action:

C39553A7-A2D2-4456-8463-33AD19FD2237.jpeg

 

Then in the html2text action:

 

DEEDCE05-DEDD-4C90-9ABC-EDE53B26AAF6.jpeg

 

1124C144-535E-47B9-8651-D0F8C535EEDA.jpeg

 

 

 So as you see, in a german Notification from the Monitoring the Subject parsed is: "Neue Meldung" followed by ":" 1 space - then 8 Digits (Number in the System) with follow "," as Deliminiter. 

The Notification (Mail Body) parsed Informations accordingly - First Block "Meldender" followed by ":" which is same in every german notification and in english the correspondenting word accordingly, the 1 space and the dynamic part of each notification begins.

 

Let´s say at "Neue Meldung" it is: Neue Meldung: 14 Spaces to compose the Number itself I guess and in english New Notification: and 34 Spaces to calculate the provided Number by itself.

 

The Entitities are same in every body such a e.g. "Meldender:", "Arbeitsplatz", then spaces are filled by power automate slash r slash n. A nice optimization would be to drop the empfy spaces to receive the detailed information.

 

but to do a filter for a condition I need to have an array, am I right?

 

From this Part on I guess the condition should set in or?

The content you get in your compose actions is a bit strange.

In the mail subject and in the mail text you are getting an object with an array, named value.

Can you show us the outputs of the trigger?
It should look like this:

schwibach_0-1706451737112.png

 

 

Also, can you click the three dots on the trigger, click "peek code" and take a screenshot like this:

schwibach_1-1706451827485.png

 


It seems to me that your trigger outputs are very different from mine even though the action seems to be the same.

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.

On the Trigger Peek Code - 2 Screenshots because of the lines:

5238F246-B14C-470A-99AA-F7D13E55B095.jpeg

 

49FD9746-DEB8-4C6B-A59E-8AEBBFB0C87C_4_5005_c.jpeg

 

I thought if it would ne possible to initialize Variable for the mail so that I could have the variables "Subject" to process in the first place the language path and with the body of the mail for that every line most begin with the same words before ":" each, except for those notifications provides by a different alarm provider which has additional. "word" with dynamic information boyond but not every time so there has to be additional condition filters to only parse those information if the expected word is in the mail.

Can you please also provide a screenshot of the trigger outputs?

The trigger action seems to be the same, but I'll need the ouputs to tell you what the dynamic reference needs to be.

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.

On the Trigger (First Step in Flow) the inputs in peek code are:

11FF06CA-6C1D-4C1B-BAD3-C79CDE19932D_4_5005_c.jpeg

 And the peek code of outputs are:

EC40F885-1DF6-4B9D-B020-592F5DCB3DAE.jpeg

 

If there is a better way to show data please let me know, I will become better by doing code stuff.

 

OK, so it seems to give you an array in your trigger.


This is what you should use to extract the subject:

triggerBody()['value'][0]['subject']

 

This for the email body:
triggerBody()['value'][0]['body']

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.

So with this both set in different compose actions, first the flow overview:

835F443B-058E-4870-826D-603CA82C3FB4.jpeg

 

Then we come to the compose action:

 

7F14E0C1-A131-4A9C-AE56-27C27E386DB6.jpeg

 

the flow runs successfully and give the following information back:

 

A152B56F-7E38-4601-B6E8-BF95C194254D.jpeg

this is for the subject of the mail and the body of the mail is:

919210A0-77CF-47DA-AFB0-E9973E9B99A5.jpeg

 so in the next step I could set a condition for select german/english but it won´t hit ...

in the german path I will select the data and according in english if the notification is in english. Also there are sometimes the phone numbers of the ticket owners so the whole entitities of the notification mail could get parsed in an sharepoint with add a new row... 

Can you show the condition?

Put a compose action in each path with the content of the email body.

__________________________________
Please mark topics as solved if they are and give kudos to make people happy 🙂
Always interested to hear about solutions/problems in the education sector.

I have now striped the flow first:

4BF9CE34-8A24-4AE2-B455-E456BA8AC47C.jpeg

 

This will show all data from the mail and so I have made two conditions to go in the german or the english path.

 

Could you say, that a switch would be better for that?

 

Condition German is:

 

712EC793-441B-4D58-8ED6-390FA4A0CDA7.jpeg

 

and in the test with the normal german notification:

 

96D5C42E-ED19-4B59-BE37-F852A63D92ED_4_5005_c.jpeg

 

and for the english notification:

 

81479EFB-BEC7-48EF-BEBA-E06679AC277E.jpeg

 

so with the test it gave back:

 

B60F7F77-F6EE-41A3-BCBF-D346CB16EECF_4_5005_c.jpeg

 

So I would think, the path´s are recognised as german so the condition is true and it contains not "New Notification" so the condition is not met as the notification is in german.

 

Then the further steps should be in the conditions - am I right? If so: Is it a good Idea to have a failsave in the No section to securely parse every notification?

 

And for variables to use later, how to process?

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (942)