web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Azure DevOps - Update ...
Power Automate
Unanswered

Azure DevOps - Update Work Item - Only Appending Last Link of Attachment in WorkItem

(0) ShareShare
ReportReport
Posted on by

Hi All,

 

Thank you for all your help in helping me build my Microsoft Flow.

 

I am building a flow where when an email arrives with attachments, it should create a work item in Azure DevOps, save the attachments in a shared point and update the links of all attachments in the description of the work item. This should retain

the previous description, and also append each link in the description for the attachments.

 

Here is how my power automate flow looks like. I am using apply for each, my understanding is, it should retain the previous body and iterate over-attachment links and update the work item, though it only update the description with last link of attachment.

 

Screen Shot 2020-08-17 at 7.42.31 pm.png

 

Screen Shot 2020-08-17 at 7.42.46 pm.png

Can anyone guide me in the right direction, please?

Thanks,

Bee

 

Categories:
I have the same question (0)
  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @Anonymous 

     

    In your apply to each loop you need to add a variable , and append to it the link from that you are generating using the concat Expression something like below:

    At the beginning of your flow , initialize variable:

    Mira_Ghaly_0-1597658685361.png

    Inside you for Each Loop:

    Add a compose data operation as below with Expression as:

    concat(variables('Links'),',',outputs('Create_sharing_link_for_a_file_or_folder')?['body/link/webUrl'])

    Mira_Ghaly_1-1597658774854.png

    Then set the variable with the output of your compose step as below:

     

     

    Mira_Ghaly_0-1597658886447.png

     

    Update the Update work Item step outside your Apply to each with the Variable.

     

    If this post helps you with your problem, please mark your as Accepted solution.

    If you like my response, please give it a Thumbs Up.

    MG (Naturally Curious)

     

     

  • Community Power Platform Member Profile Picture
    on at

    Hi @Mira_Ghaly 

     

    Thanks for your response.

     

    I have tried your solution but it is giving me the error when I try to set the variable, that variable should be initialized

    before. I did try giving some test value as well, but the error persists, please have a look

     

    Screen Shot 2020-08-17 at 8.32.02 pm.png

     

    I tried some value also to the attachment link variable, but the problem persists. Any ideas?

     

    Bee

  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @Anonymous 

    Can you show me what is in there in the compose step , paste the expression please

  • Community Power Platform Member Profile Picture
    on at

    Hi @Mira_Ghaly 

     

    I exactly used the expression which you provided, here you go, but just changed the name of the variable inside it

     

    concat(variables('attachmentLinks'),',',outputs('Create_sharing_link_for_a_file_or_folder')?['body/link/webUrl'])

     

    Please let me know, is this correct?
     
    Thanks,
    Bee
  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @Anonymous 

    There is a missing 's' in the variable name:

    concat(variables('attachmentsLinks'),',',outputs('Create_sharing_link_for_a_file_or_folder')?['body/link/webUrl'])

    Please try updated compose action above 

  • Community Power Platform Member Profile Picture
    on at

    Hi @Mira_Ghaly 

     

    I just had picked the problem :), let me try with the fix and update you whether it works or not.

     

    Thanks a ton, you are a saviour,

     

    Bee

  • Community Power Platform Member Profile Picture
    on at

    Hi @Mira_Ghaly 

     

    Thank you very much for your help. The flow has worked and i see potential two problems

     

    • When I update the work item in the last step, it overrides the previous description present. I tried it with append as well, the same behavior. So as a work-around what I did was again re-included the message body plus the variable in the description.
    • The second potential problem I see, the links are comma-separated, is there anyway, we can format the description in a more meaningful way?
    concat(variables('Links'),',',outputs('Create_sharing_link_for_a_file_or_folder')?['body/link/webUrl'])

    @Mira_Ghaly , can you help me understand the above expression. I understand concat joins the two variables together, but in above expression, I could not understand the right-hand expression. Any light over this will be helpful.

     

    Thanks a ton,

    Bee

  • Verified answer
    Mira Ghaly Profile Picture
    11,413 Moderator on at

    @Anonymous

    1. Do you add a description on the beginning of your flow, if yes then when initialising the variable set it to the description u added on create,.

    2. Right hand side of the expression is the URL of the current shareable link you have created inside the loop. 

    3. You can replace, in the concat by new line, follow these steps:

    Copy compose expression in note pad

    In the same place instead of the comma, add enter then copy the expression back from notpad to flow compose. Update field and test.

    Hope this works! 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard