Skip to main content
Community site session details

Community site session details

Session Id : 91OuxQcc8a58n06TS9G2uV
Power Automate - Building Flows
Answered

CDS - Get Attachments and Activities comments for Case Entity

Like (0) ShareShare
ReportReport
Posted on 14 Mar 2020 08:55:16 by 1,710

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!

  • Verified answer
    Amol-Kavnekar Profile Picture
    123 on 06 Nov 2020 at 07:04:20
    Re: CDS - Get Attachments and Activities comments for Case Entity

    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

     

  • EBMRay Profile Picture
    1,710 on 17 Mar 2020 at 13:24:59
    Re: CDS - Get Attachments and Activities comments for Case Entity

    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.

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 17 Mar 2020 at 11:02:41
    Re: CDS - Get Attachments and Activities comments for Case Entity

     

    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,710 on 17 Mar 2020 at 10:57:27
    Re: CDS - Get Attachments and Activities comments for Case Entity

    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,506 Most Valuable Professional on 17 Mar 2020 at 10:02:04
    Re: CDS - Get Attachments and Activities comments for Case Entity

    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,710 on 17 Mar 2020 at 09:50:16
    Re: CDS - Get Attachments and Activities comments for Case Entity

    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,506 Most Valuable Professional on 16 Mar 2020 at 00:40:15
    Re: CDS - Get Attachments and Activities comments for Case Entity

    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

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Loading started
Loading complete