How to get AGOL data and display it on a SharePoint page using JavaScript

07-06-2020 02:13 PM
New Contributor

Is there a way to connect to AGOL using JavaScript in SharePoint to display map data on a page or copy it TO a SharePoint list?

If I were to create a JS file and use REST, what would the connection look like?  Something like this which connects to a sharepoint list, but I want to connect to the AGOL database - what ever that is.

url: siteurl + "/_api/web/lists/getbytitle('Air')/items?$filter=Id eq '" + ID + "'",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
/* function hit if ajax call to is successful */
if (data.d.results.length > 0 ) {

0 Kudos
1 Reply
Esri Contributor

I know this is not exactly what you are asking but just in case you weren't aware of it, Esri has an offering called ArcGIS Maps for SharePoint:

ArcGIS Maps for SharePoint | ArcGIS 

This allows you to connect to AGOL or Enterprise to display reference layers from them. This will be easier than developing your own solution, plus you get a whole bunch of other functionality.

As far as licensing goes you just need at least one level 2 user in an organisational AGOL plan:

Frequently asked questions—ArcGIS Maps for SharePoint | ArcGIS 

0 Kudos