How can we help you today?

How to Map Document / File Type Icon when Using SharePoint Document Library REST API

If you want to display a document file type icon for your ShortPoint Design Elements, then this article can help you achieve that.

Here is an example of an option you have in our Design Element that let's you select the file type icon, instead of using the deafult one:


How to get the File Type value?



Getting File Type using REST API Connection to Document Library


The column name you are looking for is File_x0020_Type


For example, your query looks like this:


https://shortpoint.sharepoint.com/_api/web/lists/getbytitle('Templates')/items$select=FileLeafRef, EncodedAbsUrl,Modified,Created,Editor/Title&$expand=Editor&$orderby=FileLeafRef%20asc


You need to make sure you append File_x0020_Type to the query as highlighted below:


https://shortpoint.sharepoint.com/_api/web/lists/getbytitle('Templates')/items?$select=FileLeafRef,EncodedAbsUrl,Modified,Created,Editor/Title,File_x0020_Type& $expand=Editor&$
orderby=FileLeafRef%20asc

 

Once you connect ShortPoint element using above URL, you would see a new mapped column called File_x0020_Type in your mappings section:


Sample Mapping


That's it! This is how your Design Element should look like:


Sample result


Related Articles:

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

World's best intranet sites are designed using ShortPoint

Get started today! Learn more
See all 31 topics

Start a trial

Ignite your vision. Install ShortPoint directly on your site, or play in sandbox mode. No credit card required.

Get started today

World’s best intranet sites are designed using ShortPoint

Thousands of companies using ShortPoint everyday to design, brand and build award winning intranet sites.

Get started Learn more