cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DaTeusz
Regular Visitor

Adding attachments from email to Planner task with link to email itself (saving attachments to sharepoint and adding the link to email itself)

Hi Guys!

I have created a flow that triggers when user gets an email that mentiones him/her and then:

  1. Flow gets email attachments and saves it in specific folder at sharepoint.
  2. Creates a task in Planner.
  3. Assigns user who is mentioned in the mail to the task.
  4. Adds links to saved attachments to the task (using append to array).
  5. Assigns due date (if there is specific text in email body) - if not leaves it empty.

The Flow looks like this:

DaTeusz_0-1712819878629.png

DaTeusz_1-1712819887281.png

DaTeusz_2-1712819894500.png

DaTeusz_4-1712819986720.png

(sorry for the Polish names of items and actions).

 

This works great but what i want to do is to add a link to emai itself as well in the task.

 

I have worked it out how to get the link to an email (steps from the 2nd screen):

  • Compose emailLinkDaTeusz_8-1712820957436.png 
  • Compose emailLinkoutDaTeusz_6-1712820255495.png(resourcelink takes outputs from compose emailLink).

     

  • Append to array 2DaTeusz_7-1712820280813.png(value takes outputs from compose emailLinkout

     

In the 3rd screen we have steps that gets the attachments, gets attachments properties, compose that looks like this: 

DaTeusz_9-1712821054234.png

and append to array with outputs from compose that is above.

 

I have put it under condition because all of our company emails has our company logo at the bottom of each email and I don't want to save it to the sharepoint so I am skipping attachments called like our company logo file.

 

In the final steps (updating task details) we have this:

DaTeusz_10-1712821124555.png

("Załączniki" is the reference to append to array I just mentioned above).

 

I have some issues with "merging" two arrays to Update task details. Using only one of them in Update task details references works perfectly well - it adds links to attachments saved to sharepoint or link to an email. I can't combine it into one so it will give mi the task with links to attachments and link to an email itself.

 

I have tried to do it step by step by Updating task details twice:

DaTeusz_11-1712821278968.png

but this is not working.

 

Do you have any ideas how to solve it?

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @DaTeusz 

 

You can use union function to merge 2 arrays. Here is the sample:

ManishSolanki_0-1712823835329.png

[
{
"alias": "test1",
"resourceLink": "link1",
"type": "others"
}
]

ManishSolanki_1-1712823865886.png

[
{
"alias": "test2",
"resourceLink": "link2",
"type": "others"
}
]

Add another compose action to merge both arrays using an expression. To apply function, expression need to be added in the expression box as shown below:

ManishSolanki_2-1712823977839.png

union(outputs('Compose'),outputs('Compose_2'))

You can pass the final merged array to the update task details action.

 

 

Output:

ManishSolanki_3-1712824090337.png

 

 

 

If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

 

Thanks
Manish Solanki
View my blog
Linkedin

View solution in original post

Hi @DaTeusz 

 

The issue is appending json object in compose action inside loop. I would suggest using variables and append object in each variable inside loop. Don't use [] while appending object in array variables, just use the below object:

{
"alias": "<dynamic content>",
"resourceLink": "<dynamic content>",
"type": "others"
}

 

Take union of both variables outside "Apply to each" action in a compose action and pass that compose in references parameter.

 

 

 

If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

 

Thanks
Manish Solanki
View my blog
Linkedin

View solution in original post

11 REPLIES 11

Hi @DaTeusz 

 

You can use union function to merge 2 arrays. Here is the sample:

ManishSolanki_0-1712823835329.png

[
{
"alias": "test1",
"resourceLink": "link1",
"type": "others"
}
]

ManishSolanki_1-1712823865886.png

[
{
"alias": "test2",
"resourceLink": "link2",
"type": "others"
}
]

Add another compose action to merge both arrays using an expression. To apply function, expression need to be added in the expression box as shown below:

ManishSolanki_2-1712823977839.png

union(outputs('Compose'),outputs('Compose_2'))

You can pass the final merged array to the update task details action.

 

 

Output:

ManishSolanki_3-1712824090337.png

 

 

 

If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

 

Thanks
Manish Solanki
View my blog
Linkedin
DaTeusz
Regular Visitor

Hi @ManishSolanki !
We are few step closer to the result for sure but still I have some issues.
An error occured:

DaTeusz_0-1712828356020.pngDaTeusz_1-1712828363166.png

The output of the merge compose is correct:

DaTeusz_2-1712828427431.png

DaTeusz_3-1712828449544.png

But the error remains as above.

 

As far I as I am concerrned it's about setting here:

DaTeusz_4-1712828511045.png

But I thought that it has to be an array so flow will add as many attachments as it finds with for each action?

Hi @DaTeusz 

 

Pls try using a compose action for merging the arrays. Use union function in the form of expression in compose action to get the final array.

 

 

If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

 

 

Thanks
Manish Solanki
View my blog
Linkedin
DaTeusz
Regular Visitor

Hi @ManishSolanki 

I did it right at the beginnign as you mentioned in first reply, and it's here:

DaTeusz_0-1712843894190.png

DaTeusz_1-1712843905687.png

It's build as you said:

DaTeusz_2-1712843927770.png

Should I delete the final step (append to array)?:

DaTeusz_3-1712843982981.png

But what should I do with outputs from this compose?

1. Put it to append to array - then output from it to references in update task details?

or

2. Put it stright to references in update task details?

 

Sorry if questions are silly but I can't move on with this.

Hi @DaTeusz 

 

Firstly, pls verify the array elements values in compose action from the flow run instance. If compose contains all the reference links, then pass the output of compose action directly in update tasks details action.

 

 

If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

 

Thanks
Manish Solanki
View my blog
Linkedin
DaTeusz
Regular Visitor

Hi @ManishSolanki.

Yes, compose action has all of the links - and the structure is correct I belive:

DaTeusz_0-1712904802441.png

I put the outputs of this compose directly to update task details references but an error came up:

DaTeusz_2-1712904983225.pngDaTeusz_3-1712905023517.png

 

 

Hi @DaTeusz 

 

Pls pass the output of compose action directly into references parameter as shown below:

ManishSolanki_0-1712909105176.png

 

 

 

If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

 

Thanks
Manish Solanki
View my blog
Linkedin
DaTeusz
Regular Visitor

Hi @ManishSolanki 

It's not possible. Or I'm doing it wrong. 

 

First compose (with links from email) is in the loop for each. Second compose (with links from sharepoint) is in the same loop for each but under condidion. Then there is compose wit union expression.

DaTeusz_0-1712912350433.png

When I try to add it in update task details in references I can't see compose 'Połącz' (with union expression).

DaTeusz_1-1712912466202.png

That is why I added it earlier as an expression I have sent before.

 

DaTeusz
Regular Visitor

What may be important:
the output from compose with sharepoint links is:

DaTeusz_0-1712914035201.png

Output from compose with email links is:

DaTeusz_1-1712914078258.png

But the output from compose with union expression has more brackets and the null value:

DaTeusz_5-1712914245100.png

 

Hi @DaTeusz 

 

The issue is appending json object in compose action inside loop. I would suggest using variables and append object in each variable inside loop. Don't use [] while appending object in array variables, just use the below object:

{
"alias": "<dynamic content>",
"resourceLink": "<dynamic content>",
"type": "others"
}

 

Take union of both variables outside "Apply to each" action in a compose action and pass that compose in references parameter.

 

 

 

If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

 

Thanks
Manish Solanki
View my blog
Linkedin
DaTeusz
Regular Visitor

Finally!
I tried to use your advice with not to use the brackets [] but then union expression didn't work - output was only one attachment, not the link to mail.

 

What I did was:

  1. Put compose with union expression outside the for each loop.
  2. Had to add next step with filter an array to exclude the null result that came up in output from union expression compose.
  3. Then put the body from filter an array in update task details in references.

So the final steps in the flow looks like this:

DaTeusz_0-1712918105587.png


@ManishSolanki thank you so much for sharing your knowledge and a lot of patience for beginners like me!

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 | Results 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 (2,538)