cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alphadrag
Helper IV
Helper IV

Variable value

Hi all, shown in the below image is the variable value from the body of a retrieved email. I want to PAD to read the content of the 2nd last row, meaning like 531, such that if it contains "backup done", it will execute a certain task. How can I check that? Thank you all in advance for your help.

 

Alphadrag_1-1655286467347.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Alphadrag
Helper IV
Helper IV

Update:

 

I managed to retrieve the contents of the 2nd last row already.

 

Firstly, as @Gidi mentioned, I created a variable called RowCheck after splitting the text in the list and set it to BodyTextList.Count-2. This will always retrieve the 2nd last row of the body content of the email.

 

Next, based on the link @VJR provided, i created another variable called StatusCheck and set it to BodyTextList[RowCheck]. This will then retrieve the contents in that row for me.

View solution in original post

9 REPLIES 9
VJR
Super User
Super User

If your line number is constant then you can do it as per the post here.

https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Variable-Text-pull-specific-line/m-p/1626...

 

Hi, the line isnt always constant though

If you just want to find the string "backup done" anywhere in the string then you can do so using Parse Text action.

There are many backup done inside the variable value. However, i only want the 2nd last line

VJR
Super User
Super User

If you always want the second last line then do the datatable.count and decrease the count.

Using the decreased variable apply the same solution as this.

 

what do you mean by decreased variable? If you could, can you show me an example? thanks!

Hi, you can also use math operation like %datatable.count-2% to set the row number. 

How can i do something like this: %RetrievedEmails[0].Body.Count - 2%? This does not seem to work as it states that body does not have the variable count

Alphadrag
Helper IV
Helper IV

Update:

 

I managed to retrieve the contents of the 2nd last row already.

 

Firstly, as @Gidi mentioned, I created a variable called RowCheck after splitting the text in the list and set it to BodyTextList.Count-2. This will always retrieve the 2nd last row of the body content of the email.

 

Next, based on the link @VJR provided, i created another variable called StatusCheck and set it to BodyTextList[RowCheck]. This will then retrieve the contents in that row for me.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Top Solution Authors
Top Kudoed Authors
Users online (4,897)