New answers tagged

0

The various way we can display the video in the SharePoint 2013 page - below are some recommended ways: Media Web Part This Web Part has been around since SharePoint 2010. Simply add it to a page, then use the Media tab at the top to configure its properties, such as the video to look at and whether to play it automatically. This Web Part has been around ...


0

Just use below script to hide the ribbon. It will work. <script type="text/javascript"> document.getElementById("s4-ribbonrow").style.display = "none"; </script>


1

Your request should be using GetByName instead of GetByTitle So your request should be: https://mycompany.sharepoint.com/sites/testsite2/_api/web/sitegroups/getbyname('TestGroup')/users/getbyemail('john.theuser@mycompany.com') Reference: https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn531432%28v%3doffice.15%...


2

You could create an image map for this and display it using a script web part. Here is a good generator: https://www.image-map.net/ where you can define the links and clickable areas and then copy the finished code. In the resulting code you would have to update the image source to where you actually have uploaded the image, so for example <img src="...


0

How to update a person field using spHttpClient A few things to note: Before doing the actual update you must ensure the user Id of the user, this is what you will input as the field value. You must add Id to your field name. If the field name is Personyou should use PersonIdin the update body. private updatePeopleField(username: string, listname: string, ...


0

We can get user ID by the login name - using the below REST API query : http://<site url>/_api/web/sitegroups(<group id>)/users(@v)?@v='<login name>' http://<site url>/_api/web/siteusers(@v)?@v='<login name>' Similar question is discussed here : How To Get User Id Using Login Name in Share Point Provider Hosted App


0

Contribute does not allow to break role inheritance, they must have Edit at least. There is an out of the box approach that might be an alternative here (in addition to giving the users more permissions). If you turn on content approval + minor versions in your list - users can only see items they created themselves unless it is approved: Of course if the ...


1

The problem here, I suspect, is that after your validation check, when you are trying to return true; to tell the SharePoint form that it's ok to submit, you're not really returning out of your PreSaveAction function. You are returning out of your anonymous $.getJSON callback function, which is returning true back out into the inner scope of the ...


0

I assume you are trying to call Rest API with some links and retrieve the results to a filed in the page to display. Per my knowledge there are no out of the box web parts doing such work. The links web part holds the links and open the new page in a new tab. If you are using SharePoint On-Premise, you may need to use a content editor/script editor web ...


0

You could refer steps in below article to have a test: https://spjsblog.com/2012/02/25/spjs-resource-management-no-more-double-booking/


0

If you are using JavaScript, then consider using moment.js. Then format the date using moment.js. In your case you can use like this, moment(moment('30/3/2020', 'DD/MM/YYYY')).format('MM/DD/YYYY'); For no.of days count check this answer.


0

I am not sure what you want to achieve. If you want to get the number of days between two dates using JavaScript then below script can be used var date1 = new Date("06/30/2019"); var date2 = new Date("07/30/2019"); var Difference_In_Time = date2.getTime() - date1.getTime(); var Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24); If you ...


0

You can get it using calculated column in SharePoint list. Try using below formula: =DATEDIF([Column1], [Column2],"d") Reference: Calculate the difference between two dates


1

Try using this below endpoints: /_api/web/lists/getbytitle('Resourcing Entries')/items?$select=ID&$filter=ID eq 19852 Note: You need to use the Display Name of the list (Name you see on list view page). Or you can directly get the list item if you are getting the item using SharePoint OOTB ID column like: /_api/web/lists/getbytitle('Resourcing ...


1

I found an answer that is acceptable for my case to one part of the question. On the landing page of a Comm Site (and other modern pages) there is a global function that can be called to open the advanced permissions panel. _spLaunchSitePermissions() Calling this on list pages or site contents throws a not defined error. There are some more functions like ...


1

Yes you can do it like this: var restEndpointUrl; var siteUrlFromParameter = getUrlParam('Title', ''); if(siteUrlFromParameter) { //write code for setting URL when parameter is passed to your page restEndpointUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('" + listName2 + "')/items?$filter=SitePath eq '/sites/" + ...


2

Application Customizer can be the better option to add script/css to Modern Page: Inject Custom CSS on SharePoint Modern Pages using SPFx Extensions SharePoint Online Branding Inject CSS Script Editor Web Part can't be used in ListView Page, while Application Customizer can be used for All Modern Page.


4

I think best way to include JS and CSS files into a SharePoint Modern page is using SPFx Application Customizer. SPFx application customizer will be loaded on all existing and newly created modern pages in SharePoint. Downside of using Script Editor web part is you have to add the same code on each page everytime you create a new page in your site. ...


1

If you have referenced any file in your code from site assets or style library in your site then you need to check-in and publish the file after adding it to style library. Also make sure that other users has permissions to access this file.


0

So this did indeed turn out to be a jQuery issue, where jQuery (by default) does not get binary data as an ArrayBuffer, but instead returns it essentially as a string. After reading this great article on handling binary data in JS, which essentially says that when you pass a string that represents binary data directly into the Blob constructor, the Blob ...


0

Try using your code like: function addItemToSPList(getTitle, getOffice, getStartTime, getEndTime) { let holidaysColumns = { "__metadata": {"type": "SP.Data.holidaysListItem"}, "Title": getTitle, "Location": getOffice, // FYI, the column in SP is "Location" "Start Time": getStartTime, "End Time": getEndTime }; ...


1

You need to get the FileRef property from your attorneysPic library, this is the server-relative url of the file in the document library, as opposed to the url of the list item. Change your apiUrl to select the FileRef: apiUrl = "/Legal/Attorneys/_api/web/lists/GetByTitle('attorneysBio')/items?$select=*,attorneysPic/Title,attorneysPic/FileRef&$expand=...


0

Instead of Script Editor, You can create the SPFx Extenstion, Application Customizer. Do not put any UI related code in the render method and just add the code of hiding the Suite Bar using CSS or JavaScript whatever approach you want to use. Deploy the Extension on Site level and it will hide the suit bar on all the pages. Including Existing and New.


0

var listTitle = _spPageContextInfo.listTitle; Works in 2019 On Prem. Haven't tried in 2013/2016 but I bet it works there too.


Top 50 recent answers are included