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 Apps / How do I Access Dynami...
Power Apps
Unanswered

How do I Access Dynamics 365 attachments (Leads) from Notes (Annotations) via Power Automate?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a Portal Contact Us Page that accepts attachments that make their way into the Lead entity. I pick up the new Lead entry in Power Automate and I sent an email to users using an Outlook Connector to create a new email. I have the email set up as you can see in the image but I cannot figure out how to access the <NOTES (Annocations) Table >to either add the attachment to the email in Power Automate?

 

What steps are necessary in Power Automate to add the atachment into the email I am generating? 

 

2022-03-08_10-43-19.gif

I have the same question (0)
  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hello @bradlaw 

     

    Hope you are doing good.

     

    Steps to Follow:

     

    1. List Rows for Notes

        Filter _regardingobjectid_value eq 'LeadId'

    2. Get the File Content and File Name and use it 🙂

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

  • bradlaw Profile Picture
    Microsoft Employee on at

    @rampprakash,

     

    Thanks so here is what I have, where can I verify the syntax of the filter? I just cannot seem to get the filter correct? Also ocne I get this correct, do I get the File Content and File Name by initilizing them as variables?

     

    2022-03-08_13-29-33.gif

     

     

    2022-03-08_13-28-12.gif

     

     

     

     

  • Prakash4691 Profile Picture
    1,332 on at

    @bradlaw ,

    For filter rows the field you need to include is _objectid_value eq 'leadid', leadid should be from previous request. To get exact content of attachment compose an action. If there are multiple mime types involved kindly add condition to check for diff types. While sending an email, for attachment content include output of compose and file name from notes.

     

    I will include couple of screenshots for your reference.

     

    If it answers your question, kindly give kudo and accept it as solution.

     

    Prakash4691_0-1646789318505.png

    Prakash4691_2-1646789506363.png

     

     

    Regards,

    Prakash

  • bradlaw Profile Picture
    Microsoft Employee on at

    @rampprakash,

     

    Good news is I was able to follow your instructions and I am receiving an errors when running the flow. My attachment has a ".txt" attachment I assume it needs to be based on the Compose step you suggested?

     

    The error is 

     

    Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The repetition action(s) 'Apply_to_each_-_Utilize_Document_and_Send_Email' referenced by 'inputs' in action 'Compose' are not defined in the template.'.'."}}". Code: 0x80060467 InnerError: '.

     

     

    2022-03-09_16-13-55.gif

    2022-03-09_16-14-18.gif

     

     

     

     

  • Prakash4691 Profile Picture
    1,332 on at

    @bradlaw ,

    Check output of compose action whether you can able to see base64 string of file content. If it is a txt file then content type is fine or else as I mentioned earlier for different file type you need to add condition and change the content type accordingly.

     

    Regards,

    Prakash

  • bradlaw Profile Picture
    Microsoft Employee on at

    Ok. Yes, this was a text file attachment. I'll take a look.

  • bradlaw Profile Picture
    Microsoft Employee on at

    Thank you both, I still do not have this working correctly. It runs just fine with these final steps but I don't get an email from the Apply All Step? The normal send email does work above the Apply All email send however?

     

    when these two send emails are in the same flow, the first one without the Apply All does send an email. The second one with the Appy to All does not send an email. 

    2022-03-11_21-36-04.gif

     

    Even when I add the suggested Compose content like this it does not work.

     

    bradlaw_0-1647053513863.png

     

    This one does appear to run successfully in FLOW, but no email is sent. 

     

    2022-03-11_21-43-50.gif

  • Prakash4691 Profile Picture
    1,332 on at

    @bradlaw ,

    Not sure what is the issue but it should work fine.

    Validate your last run and check output for the actions which is not working as expected.

     

     

    Regards,

    Prakash

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard