cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Axal
Super User
Super User

Check a table in CDS have attachment

Hi guys,

 

In CDS, where exactly the attachment saved ? and if I have a gallery contains my table which I've some attachment in it, how to check a records (row) has attachment or not ? In that gallery I want to put some icon for indication attachments exists.

 

Thanks 

5 REPLIES 5
Mira_Ghaly
Dual Super User II
Dual Super User II

@Axal 

For attachments on your table are you using notes? or the  Field control File?

 

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.

Blog: here

Hi @Mira_Ghaly 

 

Yes, I'm using Notes.

 

Thanks,

ChrisPiasecki
Dual Super User
Dual Super User

Hi @Axal,

 

The Notes table has an Is Document column which is a Yes/No (boolean), which will indicate if the note has an attachment.

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

Hi @ChrisPiasecki ,

 

I'm sorry, may I know how to use it? I had an icon in my Gallery to identify whether my record has attachment or not and I'm trying this in its Visible property :

If(
    ThisItem.Notes.'Is Document' = true,
    true, false
)

 The intention is, if there is attachment, the icon will show else it is hidden. But seems wrong. It looks like the return of "ThisItem.Notes.'Is Document'" is a table. 

 

Beside that I also want to add another label right beside the icon, for the count of the attachments. 

 

Thanks

Hi @Axal,

 

Yes thats correct your selected item will have a collection of notes. You can use the CountIf function to determine if there are any Note records where IsAttachment is true. You can use the Count function to determine the total number of Note records for your selected item.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-counts

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Users online (1,408)