0

How to get images(randomly for specific status) displayed on 'card view' from 'images library' in SharePoint 2013, using REST API in SharePoint Designer 2013?

I've created a column(hyperlink/picture) in a list and uploaded the hyperlink in it and trying to get the image using REST API, but it doesn't seem to be working.

Is my approach right? or kindly suggest me an alternative way!!

Am new in using SharePoint designer.

Ganesh Sanap - MVP
  • 44,918
  • 21
  • 30
  • 61
  • Need more information. Provide your REST call. – Raf Dec 18 '19 at 09:58
  • "/_api/web/lists/getbytitle('Projects')/items?$select=*,RULine/Name,RULine/internalStatus,ProjectCategory/internalStatus,ProjectCategory/Name,ScientificLead/Title,ProjectStatus/Name,ProjectStatus/internalName,BDOwner/Title,AllInstitutions/Name,AllInstitutions/CCodeInternalUse,AllInstitutions/EUNonEUInternalUse,EndorsingChampion/Title,&$expand=ProjectStatus,AllInstitutions,EndorsingChampion,LegalContactsUsers,YTeamUsers,BDOwner,ProjectType,SGG,ScientificLead,ProjectCategory,RULine,samplelogo&$orderby=Title asc" Here samplelogo- hyperlink/picture column. Can you please explain this REST call? – Monika Kandregula Dec 18 '19 at 12:02
  • generally, 'select=*' means to select all, right? But in this case, after selecting all the columns, what is the query after comma? Please explain, since am new to SharePoint & REST Api – Monika Kandregula Dec 18 '19 at 12:06

1 Answers1

0

You need to exclude samplelogo from expand part. This looks like a limitation of SharePoint REST API for hyperlink column.

Or

If you need just URL link from samplelogo column(without other fields values) - just use this call - /_api/web/lists/getbytitle('Projects')/items?$select=samplelogo

These links might be helpfull for you:

Raf
  • 1,048
  • 8
  • 28
  • thanks for the links, I'll go through them – Monika Kandregula Dec 19 '19 at 09:19
  • thanks for feedback. If my answer will be helpful - please mark as answer. – Raf Dec 19 '19 at 09:31
  • Thanks Raf, the links you provided were useful.The REST call worked after I removed 'samplelogo' from the expand part.Now, my concern is to get the picture displayed on a page instead of hyperlink. Is this possible using REST call? – Monika Kandregula Dec 19 '19 at 09:33
  • Sorry, your question is not clear for me. If I understand correctly - You need to display image instead of just hyperlink? If yes - You can save hyperlink that was received by REST as workflow variable and then use this variable to set source of the picture. – Raf Dec 19 '19 at 09:43
  • Can you please guide the steps on how to save hyperlink that was received by REST as workflow variable and then use this variable to set source of the picture – Monika Kandregula Dec 20 '19 at 06:52
  • It described here - https://www.c-sharpcorner.com/article/calling-rest-api-from-a-sharepoint-designer-workflow/ – Raf Dec 20 '19 at 09:23
  • You need to save hyperlink as variable as described above and then use workflow actions "Set field" or "Update item" to insert your variable into picture field. – Raf Dec 20 '19 at 09:26
  • I've created a variable and saved hyperlink to it and then set the workflow variable to picture, but it didn't work as expected, can you please help me where am going wrong? – Monika Kandregula Jan 02 '20 at 06:29