cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mpesant
Helper I
Helper I

Element of an Array

Hello to you,

 

Scenario :

 

Get top 10 email with subject : Apple if length of top 10 email with subject apple is more than 2, if it passes, delete all email and send one email with the subject of all delete emails.

 

Get 10 email is fine.

Lenght function is fine

condition is fine

delete all email is fine.

 

ISSUE : Add the subject of all previous deleted email into a send email action is where I am stuck...

 

I tried creating an array and pulling some data from there and then extract it into a HTML table but I am stuck at calling some element under value...

 

mpesant_2-1611873600909.png

 

mpesant_4-1611873679444.png

 

Anyone can help me figuring out how to put those get email subject into 1 single email ? 

1 ACCEPTED SOLUTION

Accepted Solutions

I think I know what you mean, it is simple:

getSubject.PNG

In the select from use:  outputs('Get_emails_(V3)')?['body/value']

In the map use:  item()['Subject']
This will produce you an array of subjects.

 

You can then use them inside an email easily, by joining them with a HTML Line break with the expression:

join(body('Select'), '<br />')
 
If I understand you correctly, this should do what you want.

View solution in original post

8 REPLIES 8
v-yiwenxie-msft
Microsoft
Microsoft

Hi @mpesant 

 

I think the reason why you can't get the subjects of those deleted emails is that you have already deleted emails and you can't get the data about emails that are already deleted and not existing any more.

 

You can just simply move the step of sending an email with subjects of all deleted emails before 'delete email' action.

 

If I've misunderstood your need, please feel free to let me know.

 

Best Regards,
Community Support Team _ Kira Xie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

At some point, I'm not even trying to delete those file. 

 

I'm trying to take the output of an array and modify it but I do not know how to modify an element of a indended.

 

"value": [
{
"id": "AAMkADJiMmJlZDA1LThhMDctNDdiYS1iZTBhLWRlZWJmMzYzMjliNABGAAAAAADp3h4wO3KpT71RT466vlNhBwDqnz_u9aHjRaSokCn6UcESAAAAAAEMAADqnz_u9aHjRaSokCn6UcESAABaCgQxAAA=",
"receivedDateTime": "2021-01-28T20:18:31+00:00"

 

I'm able to change "VALUE" but not like receiveddatetime element.

Paulie78
Super User
Super User

I don't think I really understand what you are attempting to do, but you can change the value of receivedDateTime like this:

2021-01-29_10-11-50.jpg

Result is:

{
  "id": "AAMkADJiMmJlZDA1LThhMDctNDdiYS1iZTBhLWRlZWJmMzYzMjliNABGAAAAAADp3h4wO3KpT71RT466vlNhBwDqnz_u9aHjRaSokCn6UcESAAAAAAEMAADqnz_u9aHjRaSokCn6UcESAABaCgQxAAA=",
  "receivedDateTime": "NewValue"
}

when I try the same : 

 

mpesant_0-1611928086410.png

 

Paulie78
Super User
Super User

its "outputs" not "output"

mpesant
Helper I
Helper I

 I'll try to be more clear.

 

When I do a length function on "get Email" it return 4.

When I create an array on get email and then a length function on the array, it returns me 1. 

 

I want to be able to get all subject from the array or get email into 1 single email

 

If I do it directly inside get email, it does apply a apply to each which I DO NOT want. 

 

GOAL : 1 email containing 5 previous subject email.

 

 

I think I know what you mean, it is simple:

getSubject.PNG

In the select from use:  outputs('Get_emails_(V3)')?['body/value']

In the map use:  item()['Subject']
This will produce you an array of subjects.

 

You can then use them inside an email easily, by joining them with a HTML Line break with the expression:

join(body('Select'), '<br />')
 
If I understand you correctly, this should do what you want.
mpesant
Helper I
Helper I

Gosh! I knew I was going way too far... Thx mate! 

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

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

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,718)