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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / CDS - Get Attachments ...
Power Automate
Answered

CDS - Get Attachments and Activities comments for Case Entity

(0) ShareShare
ReportReport
Posted on by 1,712

Hello,

Recently, I have installed the PowerApps Customer Self Service Portal.

I have created a flow for this portal that triggers whenever a case is updated.
In the update form, there is a section called "Timeline" where the user can add Comments and upload some attachments.
After they submit the updates, the comments will be stored in the "Activities" entity and the "Attachments" in the Notes entity under the case created.
AddAComment.PNG
Activities.PNGAttachments.PNG

What I want to achieve is the following:

I am trying to find a way to get the updated attachments and the activities comments regarding the case.

After, when I have found these data I want to send an email that contains the attachments added and the comments (Activities) regarding the case id.

I am using CDS connectors (current environment), I have used the "Get file or image content" action but I don't know what I have to choose for the field name.
GetFile.PNG


Besides, concerning the "Activities" I have tried to use "Get record" action regarding the case ID, but the flow fails because he didn't find the case ID in the "Activities" entity. I am stuck what I have to choose for the "Item Identifier".
CaptureAct.PNG
Can please someone explains in detail and provides an example for this scenario?

Any help would be greatly appreciated.
Thank you!

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Julien2 

     

    Please follow the below steps:

     

    image.png

     

    Above the filter query I have hardcoded the GUID of my test record. In your case you need map your caseid here within single quotes.

     

    image.png

     

    Let me know if you have anymore questions.

     

    Thanks

  • EBMRay Profile Picture
    1,712 on at

    Hello @abm ,

    Thanks for sharing an example to get the uploaded attachments regarding the case.

    1. Unfortunately, the images received in the email are not displaying and their types are "PNG". What should I modify to allow the email to accept PNG format?
    Capture.PNG

    2. I have also asked about the activities' comments regarding the case. Could you please provide an example of the following?

    Thanks again.
    Regards,
    Julien

  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Julien2 

     

    The solution I provided is tested with png file. I did uploaded a png file under attachment notes. I have received the attachment as expected format via email. Make sure you are uploading the right image. I really can't answer it specifically why you not getting the attachment with an unreadable format.

     

    If you need the comment there is a dynamic property called "Description" which you need to map.

     

    Thanks

  • EBMRay Profile Picture
    1,712 on at

    Hello @abm ,

    I have figured out that the uploaded "Attachments" and "Comments" are stored in the Activities inside the "Portal Comments" entity and not in the Notes entity.

    Unfortunately, in the List records of the Portal Comments, there is not a dynamic property called "File Name" either Document to get the attachments knowing that inside this entity, there is a "Notes" field.

    Please have a look at the screenshots below:
    Capture.JPGCapture1.JPG

     

    Any idea how to get the attachments inside this entity regarding the case id?

    Looking forward to hearing from you.
    Thank you!

  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

     

    In Dynamics all the attachments are stored under Notes entity. You need to pass your regarding id GUID (Portal Comment record id) against notes.

     

    Thanks

    Hi @Julien2 

  • EBMRay Profile Picture
    1,712 on at

    Hello @abm ,

    I have passed the RegardingID Value to the object id value of the Notes entity. (Here the flow creates an apply to each action).
    Inside this apply to each I have added apply to each action of the attachments, because if I put it outside I will not be able to find "Filename" and "Document" from the dynamic property.

    Unfortunately, as a result, the flow has not entered the apply to each action of the attachments so it's skipped. I have also tried to put it outside the apply to each action of the list records, and  I have used the expressions of the filename and the document but it returns null.

     

    item()?['filename']
    item()?['documentbody']

     

    Please have a look at screenshots below:
    PortalComments.JPGRegarding.JPG

    Could you please provide an example of this?

    Looking forward to your response.
    Thank you.

  • Verified answer
    Amol-Kavnekar Profile Picture
    125 on at

    HI  @Julien2 , 

    I also faced the same issue, mages received in the email are not displaying for that i have done some changes in Power automate as below ,

     

    Attachment.png

     

     

    Instead of document use base64ToBinary(items('apply_to_each')?['documentbody']) 

    it work properly.

     

    Thanks ,


    Did I answer your question? Mark my post as a solution!

    If you liked my response, please consider giving it a thumbs up

    1.png

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 997

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 642

Last 30 days Overall leaderboard