DataLaVista™¶
Install DataLaVista in SharePoint¶
This page explains how to add DataLaVista to a SharePoint Online site, how to
update it later, and what to do when the page does not start. It is for site
owners who can add files to the site's Site Assets library and create pages.
You need no developer tools, only the two files from the dist folder.
Before you start¶
- A SharePoint Online site where you can create pages and add files to the Site Assets library.
- The Modern Script Editor web part. If it is not available on your site, ask your site administrator to install it. The link is under "Additional resources".
- The
distfolder of this repository. On the repository's GitHub page, select Code, then Download ZIP, and unzip the file.
Files you need¶
| File | What you do with it | What it is |
|---|---|---|
dist/datalavista.js |
Upload it to the scripts folder in Site Assets. |
The DataLaVista app with every library it needs packed inside. |
dist/DataLaVista-sp.html.txt |
Copy its contents into the web part. | Two lines of page code that show the app and load the script. |
Because every library is inside datalavista.js, the page loads nothing from
other websites. A tenant policy that allows only scripts from the site itself is
enough. docs/compliance.md lists what remains to be confirmed in a tenant with
that policy.
Install¶
- Open your site's Site Assets library. Go to Settings, then Site contents, then Site Assets.
- Select New, then Folder, and name the folder
scripts. Skip this step if the folder is already there. - Open the
scriptsfolder and uploaddist/datalavista.jsinto it. - Go to the site's home page and select New, then Page. Choose the Modern Script Editor template.
- Name the page
DataLaVista. Its address then ends in/SitePages/DataLaVista.aspx, such ashttps://contoso.sharepoint.com/sites/example/SitePages/DataLaVista.aspx. Keep the page in Site Pages itself, not in a folder inside it. The page code finds the script at../SiteAssets/scripts/datalavista.js, which only works from there. The list formatting insrc/sp-view-formatting.jsonalso links to that address. - In the Modern Script Editor web part, select Markup, then the { } button to open the code editor.
-
Open
dist/DataLaVista-sp.html.txtin a text editor, copy everything in it, and paste it into the code editor. After a comment with these steps, it looks like this:<div id="dlv-root"></div> <script src="../SiteAssets/scripts/datalavista.js"></script> -
Select Save in the code editor, then Save on the page to leave edit mode.
- Refresh the page. The Connect to Data Source popup opens with your site's address filled in.
Update to a newer version¶
- Download the latest
distfolder from GitHub. - Upload the new
dist/datalavista.jsto thescriptsfolder in Site Assets, replacing the old one. - Refresh the DataLaVista page. If the old version still shows, press Ctrl+F5 to reload without the browser's saved copy.
You do not need to change the page unless a release says so.
If the page does not start¶
DataLaVista writes a message into the page when it cannot start. Each message says what to do next.
- "DataLaVista could not start because its built-in ... library did not load." Another script on the page kept a library from loading. Remove other code from the page's web parts and refresh. If it happens again, ask your site administrator and mention the errors in the browser console.
- The page stays blank. Open the browser console (F12). If it says the script
could not be found, check that
datalavista.jsis in thescriptsfolder of Site Assets and that the page is directly in Site Pages. If it says the script was blocked, ask your SharePoint administrator whether the tenant's content security policy allows scripts from the site's own Site Assets library. - "DataLaVista could not find
<div id="dlv-root">" in the console. The web part code was not pasted in full. Paste the whole contents ofdist/DataLaVista-sp.html.txtagain.
Conclusion¶
You can now add DataLaVista to a site with one uploaded file and one pasted snippet, and replace the file to update it. Next, connect a SharePoint list or a data file from the Connect to Data Source popup, as Connect to data describes.