cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
felixthecatx
Regular Visitor

Converting List Item with Image column to PDF

Hello, 

 

I am trying to convert individual SharePoint list items to PDF. I am formatting objects into an HTML format before converting to PDF. The problem I am having is the thumbnail objects associated with the image column. All of the other dynamic objects associated with the other columns transfer fine. 

felixthecatx_1-1660759656584.png

Can anyone suggest how I should initialize, format the image object into html? 

felixthecatx_2-1660759712749.png

Picture variable is 

decodeBase64(outputs('Get_item')?['body/{Thumbnail}/Large'])
 
Thank you! 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @felixthecatx ,

 

Do you want to get the content of the image in the image field?

 

If so ,I've made a test for your reference:

1\My list

vbofengmsft_0-1660891088507.png

2\The flow

vbofengmsft_1-1660891104522.png

1)

_api/Web/Lists/getByTitle('<list name>')/items(<Listitemid>)/?$select=<image_column_name>

2)

json(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['ImageColumn'])

3)

skip(outputs('Compose')['serverRelativeUrl'],nthIndexOf(outputs('Compose')['serverRelativeUrl'],'/',3))

3\Result

vbofengmsft_2-1660891200112.jpeg

 

Best Regards,

Bof

 

 

View solution in original post

5 REPLIES 5
v-bofeng-msft
Community Support
Community Support

Hi @felixthecatx ,

 

Do you want to get the content of the image in the image field?

 

If so ,I've made a test for your reference:

1\My list

vbofengmsft_0-1660891088507.png

2\The flow

vbofengmsft_1-1660891104522.png

1)

_api/Web/Lists/getByTitle('<list name>')/items(<Listitemid>)/?$select=<image_column_name>

2)

json(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['ImageColumn'])

3)

skip(outputs('Compose')['serverRelativeUrl'],nthIndexOf(outputs('Compose')['serverRelativeUrl'],'/',3))

3\Result

vbofengmsft_2-1660891200112.jpeg

 

Best Regards,

Bof

 

 

Hi @v-bofeng-msft,

 

To answer your question, if getting the image content will allow me to transfer it to html then that is what I am after. I'm trying to implement your solution but wanted to ask about the File Path statement. Where do I find the 'serverRelativeUrl' ? Is that something I need to find, or can I just use the statement you posted? 

 

Thanks for your input

Hi @felixthecatx ,

 

You could try my flow first , if there is any problem you could follow this post.

 

Best Regards,

Bof

Hi @v-bofeng-msft ,

 

The flow is returning a bad request at the send http request to sharepoint stage. 

 

"The field or property 'Photo' does not exist."

 

The column does exist in my list. Do you have any ideas why it is not recognizing it? 

felixthecatx_0-1661796536752.png

 

 

Hi @v-bofeng-msft ,

 

I fixed the bad request, and the output of 'Send an HTTP request to SharePoint' is locating the correct picture. However the file is not being found in the 'Get file content using path'. I'm assuming this is due to a problem in the Compose step. The line I have in Compose is 

 

json(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['Image'])

 

Are there any further thoughts or resources you can direct me to? I'm hoping Microsoft establishes functionality for the Thumnail objects for this column soon...

felixthecatx_0-1661888562226.png

 

Thanks

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,288)