Hot answers tagged

7 votes

How to encode a list name for REST in sharepoint 2013

Try using encodeURIComponent to encode the list title. However, encodeURIComponent does not encode apostrophe. For apostrophes use %27 twice or two apostrophes ''. See this for more detail: http://www....
Nadeem Yousuf-AIS's user avatar
7 votes

How can I change URL of existing list?

Using Powershall Script , change list URL. Add-PSSnapin Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue $libOriginalUrl = "/Lists/YourLibName1"; $libNewUrl = "/YourLibName2"; $web = ...
Dipen Shah's user avatar
  • 1,128
7 votes
Accepted

how to open URL Field link in new window SharePoint 2013

Open in new tab is only supported in Publishing URL field. You are using the basic URL field. You need to use PublishingWebControls:RichLinkField. This will give you the "open in new window" option. ...
Aks's user avatar
  • 487
7 votes
Accepted

Dynamically passing URL

The special characters should be encoded. Try encodeURI(attachmentsURL).
Erin L's user avatar
  • 4,038
7 votes
Accepted

Delete URL after rename [SP online]

The redirect is by design as noted in the docs: https://docs.microsoft.com/en-us/sharepoint/change-site-address - It will stay this way to make sure that all old links to the site still will work ...
Rune Sperre's user avatar
  • 2,249
6 votes

Create a link to "New Document" template link

Use this method: ms-word:nft|u|TEMPLATE URL HERE|s|SAVE LOCATION HERE ^That is the URL Note: The beginning prefix tells the browser which tool to launch. So if the template is an Excel file, you'...
Scott Colvin's user avatar
6 votes
Accepted

SharePoint Online - Redirect to another page using Javascript

Try it as below: if(location.href === 'https://mysite.sharepoint.com/sites/ABC/SitePages/SPage.aspx') { location.href = "https://mysite.sharepoint.com/sites/ABC/SitePages/Pages.aspx"; }
Gautam Sheth's user avatar
  • 30.8k
6 votes

how to open URL Field link in new window SharePoint 2013

Since the control has a CssClass Property, you could manipulate the target attribute using JQuery. For example (not tested): <SharePointWebControls:UrlField ID="UrlField2" FieldName="Link Button" ...
Andy Wijaya's user avatar
5 votes

Whats the URL length limit for SharePoint 2013 REST GET requests?

it is still same for IE11 and SharePoint 2013 WinINET.h defines INTERNET_MAX_URL_LENGTH as 2083 characters, and this limit remains in force in a number of places. http://blogs.msdn.com/b/...
Waqas Sarwar MVP's user avatar
5 votes

Is it possible to get an SPList object with just a Url?

Or the easier method of: using (var site = new SPSite(url)){ using (var web = site.OpenWeb()){ var list = web.GetList(url); } }
Someone's user avatar
  • 51
5 votes
Accepted

What is the proper way to escape an equals ( "=" ) in a custom form with xslt?

There is no issue with the equals sign, the issue is with the ampersand, that has to be escaped as &amp; https://stackoverflow.com/questions/1328538/how-do-i-escape-ampersands-in-xml There are 5 ...
Eric Alexander's user avatar
5 votes

Modify SharePoint Online Site Collection URL

Short answer, no, not possible a without migration of some sort.
Eric Alexander's user avatar
5 votes
Accepted

SharePoint Online - How to redirect a URL?

You "could" add a CEWP to the homepage to insert some javascript to redirect them automatically. <script> window.location.href = "https://sharepointtenant.sharepoint.com/"; </script> ...
Mike's user avatar
  • 12.2k
5 votes
Accepted

Custom URL for sharepoint Online

What @bonm014 said is true: it's not possible. The Microsoft's User Voice channel is the source for requested features and their status. Changing the tenant's name is one of the often requested ...
moe's user avatar
  • 5,267
4 votes

How to get a file using SharePoint Client Object Model with only an absolute url at hand?

Try something like this Uri filename = new Uri(@"file full url"); var f = this.Web.GetFileByServerRelativeUrl(filename.AbsolutePath); var stream = f.OpenBinaryStream(); this.Context.Load(f); this....
yunui's user avatar
  • 81
4 votes
Accepted

SP - How to Redirect to same page with SPUtility

Please try HttpContext.Current.Request.Url.PathAndQuery inplace of this.Page.Request.Url.AbsolutePath It will get you the URL with querystring parameteres
Hardik's user avatar
  • 7,733
4 votes

how to get site collection url from SharePoint Hosted App

In your App url there are various Query String Parameters as shown here. That already containts the site collection url. The Query String paramter "SPHostUrl" will give you the site collection URl. ...
Aakash Maurya's user avatar
4 votes
Accepted

Get ServerRelativeUrl from Full Url -CSOM

Following code will return the ServerRelativeUrl: Uri uri = new Uri(fullURL); string serverRelativeURL = uri.AbsolutePath;
Sivakumar Piratheeban's user avatar
4 votes
Accepted

Get current url inside a Script Editor

I think you need to put url instead SiteUrl it will be like this : string url = SPContext.Current.Site.Url; however this code will not run try to use page variable _spPageContextInfo : string url = ...
Youssef Moumen El idrissi's user avatar
3 votes

Open specific excel sheet from sharepoint URL

?web=1 works to open the spreadsheet in a web browser, thanks to @Vincent Crenshaw but ?range='YourWorksheetName' doesn't work. Finally, this works for me: https://superuser.com/a/1115331 https://...
Peter Wangxin's user avatar
3 votes

Open specific excel sheet from sharepoint URL

That # symbol in URL usually divides an address and fragment location, and fragment location is never transmitted to server, but handled by client. See https://en.wikipedia.org/wiki/...
Aziz Kabyshev's user avatar
3 votes
Accepted

Newly created site collection could not be found

Looks like you miss the most important root level site collection. Could you please create the root level site collection on qwe web app. this site should be on "/" path. When you go to Create new ...
Waqas Sarwar MVP's user avatar
3 votes
Accepted

REST document url

FileRef should give you the document's relative URL. $select should look like $select=FileLeafRef,FileRef,Modified,CheckoutUserId,AuthorId,OData__UIVersionString FileRef vs FileLeafRef FileRef is ...
Atish Kumar Dipongkor's user avatar
3 votes
Accepted

Is there a URL that will allow users to open a survey (in it's own dialog box) without having to click the "Respond to Survey" button?

WITHOUT CODE: I always send them straight to the New Form for surveys: http://sharepoint/site/Lists/SurveyName/NewForm.aspx WITH CODE: <script> function openDialog(){ var ...
Erin L's user avatar
  • 4,038
3 votes
Accepted

Filter library by current user using url

Using JSOM you can find the current user login and create the View URL dynamically. var clientContext = new SP.ClientContext.get_current(); var oWeb = clientContext.get_web(); var currentUser = oWeb....
Amal Hashim's user avatar
  • 28.3k
3 votes
Accepted

how to get site collection url from SharePoint Hosted App

From your SharePoint Hosted app what you can get context of host web and fetch the url of site collection You can use RequestExecutor for cross domain request as $.getScript(hostUrl + "/_layouts/15/"...
Mrunal Shidurkar's user avatar
3 votes
Accepted

Is there a way to have a url instead of a document in a library

You can just add a Link to a Document content type Library settings -> Advanced settings -> Set "Allow management of content types?" to "Yes" Under content Types group, click "Add from existing site ...
Denis Molodtsov's user avatar
3 votes
Accepted

Sharepoint site url

in the same web app, creating the site collection with different url can be achieved using the HNSC or Create new web app with that url. Host Name Site collection have their own url. You can follow ...
Waqas Sarwar MVP's user avatar
3 votes

Sharepoint site url

The near solution is to achive that is to define managed paths in SharePoint . where you can specify the paths in the URL namespace of a web application to use for site collections. There are two ...
Mohamed El-Qassas MVP's user avatar
3 votes

SharePoint Online - Redirect to another page using Javascript

first convert the LHS and RHS to lowercase and compare. var spageUrl = 'https://mysite.sharepoint.com/sites/ABC/SitePages/SPage.aspx'; if(location.href.toLowerCase() === spageUrl.toLowerCase()) { ...
Amit's user avatar
  • 2,019

Only top scored, non community-wiki answers of a minimum length are eligible