cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Crai8088
Level: Powered On

CDS Attatchment

Hi There, 

 

Does anybody know if you can open a CDS Attachment in the PDF Viewer? 

 

I have a Gallery that holds the "News" articles all of which have a PDF Attachment stored within CDS, i want the users to be able to click an Open button which then assigned a Variable and displays the PDF View with the associated PDF File? 

 

On my Open button i have: 

Set(AttachFile, Parent.Selected.'{Attachments}'); UpdateContext({ShowReader:true})

 And then set the Document Property of the PDF Viewer as AttachFile, 

 

However this produces the error: The property expects Blob Values, but this rule produces incompatable table values. 

 

Can anybody advise if this is possible please? 

 

Thanks

Craig

1 ACCEPTED SOLUTION

Accepted Solutions
Crai8088
Level: Powered On

Re: CDS Attatchment

Hi @v-monli-msft

 

Thank you for your response, i am setting the formula from within the Gallery Control on a Icon. I have just managed to get this to work by assigning the Guid to the Variable and using that as a LookUp instead

 

First(LookUp(Announcements, cl_announcementsid = AttachFile).'{Attachments}').Value

What i do find intresting is that the Controls do not have a save function. I have ended up adding the attachment control transparently on top of the reader to just show the PDF Icon, this seems to work

Capture.PNG

 

Thank you for your help, you definately pointed me in the right direction.

 

 

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: CDS Attatchment

Hi @Crai8088,

 

Parent.Selected won't work if the formula is outside of the Gallery control. And also you cannot set the attachment file in a variable. 

 

And also, it seems that you cannot insert the PDF viewer in Gallery control or Form control. So, the only way I make this work so far is using below formula on the Document property of PDF viewer:

First(First(DataSourceName).'{Attachments}').Value

For your reference about add attachments to CDS:

https://powerapps.microsoft.com/en-us/blog/add-attachments-to-your-common-data-service-entities/

 

A thread discussion about SharePoint Attachment in PDF viewer:

https://powerusers.microsoft.com/t5/Connecting-to-Data/How-to-open-sharepoint-PDFs-in-PowerApps/td-p...

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Crai8088
Level: Powered On

Re: CDS Attatchment

Hi @v-monli-msft

 

Thank you for your response, i am setting the formula from within the Gallery Control on a Icon. I have just managed to get this to work by assigning the Guid to the Variable and using that as a LookUp instead

 

First(LookUp(Announcements, cl_announcementsid = AttachFile).'{Attachments}').Value

What i do find intresting is that the Controls do not have a save function. I have ended up adding the attachment control transparently on top of the reader to just show the PDF Icon, this seems to work

Capture.PNG

 

Thank you for your help, you definately pointed me in the right direction.

 

 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,746)