Articles about European Sharepoint Hosting Service
Posts tagged Spain Sharepoint 2013 Hosting

SharePoint 2013 Hosting – HostForLIFE.eu :: How to Create a SharePoint Hosted App on SharePoint 2013
May 13th
A SharePoint Hosted App (SHA) can have all elements deployed to a SharePoint server. Optionally there may be JavaScript components running within the client side. First, you should have the subsequent pre-requisites done to make a SharePoint Hosted App.
And then, open Visual Studio 2013 in Administrator mode. Select New Project > SharePoint > App for SharePoint 2013 as shown below.
In the next dialog select the SharePoint-hosted app option.
You will get the following items created within the solution explorer.
Run the application and if the compilation was successful you’ll get the password prompt shown on the below picture:
And here is the application should look.
The Page default.aspx is the main page.
You should use a non-System account for developing apps.
The page displays a hello message with the current user name. this user name is displayed using a JavaScript that you simply will notice within the App.js
SharePoint 2013 Hosting Recommendation
HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options.

SharePoint 2013 Hosting Spain – HostForLIFE.eu :: How to Retrieve All The Users Following using REST in SharePoint 2013?
May 6th
In this post, let me show you How to Retrieve All The users following the current user using REST in SharePoint 2013. This article helps to retrieve all the users following the current user using REST in SharePoint 2013. this is often developed using the NAPA development tool.
Step 1: On your Developer website, open the “Napa” office 365 Development Tools and so select Add New Project.
- Select the App for SharePoint template, name the project and so click the create button.
- Replace Default.aspx with the following code.
- Replace APP.js with the following source code.
- Publish Your App.
Step 2: Now, you must Change the permission:
Tenant = Write
User Profiles = Read
Step 3: Update the Default.aspx and App.js files
Default Aspx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
'use strict'; var hostweburl; var appweburl; var myFollowerEndpoint; var followers; $(document).ready(function(){ hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl")); appweburl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl")) myFollowerEndpoint = decodeURIComponent(appweburl) + "/_api/social.following"; getMyFollowers(); }); function getQueryStringParameter(paramToRetrieve) { var params = document.URL.split("?")[1].split("&"); for (var i=0; i<params.length; i= i + 1) { var singleParam = params[i].split("="); if(singleParam[0] == paramToRetrieve) return singleParam[1]; } } function getMyFollowers() { $.ajax( { url: myFollowerEndpoint + "/my/followers", headers: { "accept": "application/json;odata=verbose" }, success: myFollowersSuccessHandler, error: myFollowersErrorHandler }); } function myFollowersSuccessHandler(data) { var stringData = JSON.stringify(data); var jsonObject = JSON.parse(stringData); var folResult = jsonObject.d.Followers.results; followers = "<p>The Person who follows you are:</p>"; for (var i=0; i<folResult.length; i++) { followers+= "<P>"+folResult[i].Name+"</p>"; } document.getElementById("myFollowersResult").innerHTML = followers; } function myFollowersErrorHandler(data,errorcode,errormessage) { alert("Couldn't get the followers " + errormessage); } |
Step 4
Finally, publish the solution and then click the Trust It Button.
SharePoint 2013 Hosting Recommendation
HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options.
SharePoint 2013 Hosting Russia – Generate Workflow Reports in SharePoint
Apr 29th
This articles outlines a way to generate workflow reports (in-progress workflows and completed workflows) using a PowerShell script in SharePoint 2013. Consider a situation wherever you configure a work flow for a list to alert you when a new item is added or there are any changes to an existing item. In this case workflow item would have a separate instance of work flow.
Consider a list with thousands of things, wherever it’s tedious to visualize the workflow status on every item manually, here PowerShell is helpful. The PowerShell script explained in this article loops through all the websites beneath a site collection and every one the lists beneath each web and all the items under each list and generates 2 separate reports, one to hold the in-progress work flow details and also the other to hold the completed workflow details.
The following piece of code generates the workflow reports:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
Function WorkflowReports() { $output = $scriptbase + "\" + "InProgressWorkflows.csv" "SiteCollection" + "," + "WebURL" + "," + "List" + "," + "ItemName" + "," + "ItemGUID" + "," + "WorkflowInstanceID" | Out-File -Encoding Default -FilePath $Output; $output1 = $scriptbase + "\" + "OtherWorkflows.csv" "SiteCollection" + "," + "WebURL" + "," + "List" + "," + "ItemName" + "," + "ItemGUID" + "," + "WorkflowInstanceID" | Out-File -Encoding Default -FilePath $Output1; Write-host "Getting workflow report" -fore magenta $SiteCollectionURL = read-host "Enter site collection URL " $siteCollection = get-spsite $SiteCollectionURL -ea silentlycontinue if($SiteCollection -ne $null) { foreach($web in $SiteCollection.allwebs) { $lists = $web.lists foreach($list in $lists) { foreach($item in $list.items) { foreach($workflow in $item.workflows) { if($workflow.iscompleted -eq $false) { $SiteCollectionURL + "," + $web.url + "," + $list.Title + "," + $workflow.ItemName + "," + $workflow.ItemGUID + "," + $workflow.InstanceId | Out-File -Encoding Default -Append -FilePath $Output; } else { $SiteCollectionURL + "," + $web.url + "," + $list.Title + "," + $workflow.ItemName + "," + $workflow.ItemGUID + "," + $workflow.InstanceId | Out-File -Encoding Default -Append -FilePath $Output1; } } } } } Write-host "Reports generated and available at the script location " -fore green } else { write-host "Invalid site collection.... please check the URL...." -fore red } } |
And the following code is the complete code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
$LogTime = Get-Date -Format yyyy-MM-dd_hh-mm $LogFile = ".\WorkflowDetailsPatch-$LogTime.rtf" # Add SharePoint PowerShell Snapin if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) { Add-PSSnapin Microsoft.SharePoint.Powershell } $scriptBase = split-path $SCRIPT:MyInvocation.MyCommand.Path -parent Set-Location $scriptBase write-host "TESTING FOR LOG FOLDER EXISTENCE" -fore yellow $TestLogFolder = test-path -path $scriptbase\Logs if($TestLogFolder) { write-host "The log folder already exist in the script location" -fore yellow $clearlogfolder = read- host "Do you want to clear the log folder (y/n)" if($clearlogfolder -eq 'y') { write-host "The user choosen to clear the log folder" -fore yellow write-host "Clearing the log folder" -fore yellow remove-item $scriptbase\Logs\* -recurse -confirm:$false write-host "Log folder cleared" -fore yellow } else { write-host "The user choosen not to clear the log files" -fore yellow } } else { write-host "Log folder does not exist" -fore yellow write-host "Creating a log folder" -fore yellow New-Item $Scriptbase\Logs -type directory write-host "Log folder created" -fore yellow } #moving any .rtf files in the scriptbase location $FindRTFFile = Get-ChildItem $scriptBase\*.* -include *.rtf if($FindRTFFile) { write-host "Some old log files are found in the script location" -fore yellow write-host "Moving old log files into the Logs folder" -fore yellow foreach($file in $FindRTFFile) { move-item -path $file -destination $scriptbase\logs } write-host "Old log files moved successfully" -fore yellow } start-transcript $logfile Function WorkflowReports() { $output = $scriptbase + "\" + "InProgressWorkflows.csv" "SiteCollection" + "," + "WebURL" + "," + "List" + "," + "ItemName" + "," + "ItemGUID" + "," + "WorkflowInstanceID" | Out-File -Encoding Default -FilePath $Output; $output1 = $scriptbase + "\" + "OtherWorkflows.csv" "SiteCollection" + "," + "WebURL" + "," + "List" + "," + "ItemName" + "," + "ItemGUID" + "," + "WorkflowInstanceID" | Out-File -Encoding Default -FilePath $Output1; Write-host "Getting workflow report" -fore magenta $SiteCollectionURL = read-host "Enter site collection URL " $siteCollection = get-spsite $SiteCollectionURL -ea silentlycontinue if($SiteCollection -ne $null) { foreach($web in $SiteCollection.allwebs) { $lists = $web.lists foreach($list in $lists) { foreach($item in $list.items) { foreach($workflow in $item.workflows) { if($workflow.iscompleted -eq $false) { $SiteCollectionURL + "," + $web.url + "," + $list.Title + "," + $workflow.ItemName + "," + $workflow.ItemGUID + "," + $workflow.InstanceId | Out-File -Encoding Default -Append -FilePath $Output; } else { $SiteCollectionURL + "," + $web.url + "," + $list.Title + "," + $workflow.ItemName + "," + $workflow.ItemGUID + "," + $workflow.InstanceId | Out-File -Encoding Default -Append -FilePath $Output1; } } } } } Write-host "Reports generated and available at the script location " -fore green } else { write-host "Invalid site collection.... please check the URL...." -fore red } } WorkflowReports write-host "" write-host "SCRIPT COMPLETED" -fore green stop-transcript |
I hope this tutorial works for you!
SharePoint 2013 Hosting Recommendation
HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options.

SharePoint 2013 Hosting – HostForLIFE.eu :: How to Get Current Logged in User and Display Name using SharePoint 2013 REST API.
Apr 23rd
REST API is quite simple and straightforward, used User ID to get user Title, Email for SharePoint 2013 and apps for SharePoint. use /_api/web/getuserbyid(ID) to get the user field in the response data, we have an “AuthorId” will get us the user Title, Email etc. In this post, I’m gonna tell you how to get current logged in user and display name using SharePoint 2013 REST API.
Follow these steps to get current logged in user and display name using SharePoint 2013 REST API:
Step 1
Navigate to your SharePoint 2013 site and create a Wiki Page or a Web Parts page.
Step 2
Next, add your JavaScript code is quite straightforward:
Edit the page, go to the “Insert” tab in the Ribbon and click the “Web Part” option. In the “Web Parts” picker area, go to the “Media and Content” category, select the “Script Editor” Web Part and press the “Add button”.
Step 3
Once the Web Part is inserted into the page, you will see an “EDIT SNIPPET” link click. You can insert this HTML and/or JavaScript code into the dialog:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<script src="/Style Library/scripts/jquery-1.10.1.min.js"></script> <script type="text/javascript"> var userid= _spPageContextInfo.userId; var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getuserbyid(" + userid + ")"; var requestHeaders = { "accept" : "application/json;odata=verbose" }; $.ajax({ url : requestUri, contentType : "application/json;odata=verbose", headers : requestHeaders, success : onSuccess, error : onError }); function onSuccess(data, request){ var Logg = data.d; //get login name var loginName = Logg.LoginName.split('|')[1]; alert(loginName); //get display name alert(Logg.Title); } function onError(error) { alert("error"); } </script> |
In the code above, you’ll get the author id from the list. By passing the author id in to GetUserBuId() method, it will return the user in raw format like “I:O#.f|xxxx|xx@xxxx.com”. Then, you can get the log in name by splitting the output.
SharePoint 2013 Hosting Recommendation
HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options.

SharePoint 2013 Hosting – HostForLIFE.eu :: How to Retrieve Followed Sites in SharePoint 2013 Using REST API ?
Apr 22nd
In this post, let me tell you about How to Retrieve Followed Sites in SharePoint 2013 Using REST API. We can use the SharePoint 2013 representational State Transfer (REST) service to try to to constant tasks you’ll be able to do when you use the .NetCSOM, JSOM.
Here I make a case for a way to retrieve the site name and url followed by the current user in SharePoint 2013 using a client object model (REST API and JavaScript) and displaying it in the SharePoint page.
1. Make a new page and a Content Editor Webpart (CEWP)
2. And now, edit the web part that was added to the page as shown on the below picture:
3. And then , upload your text file script into the site assests & copy the path of the text file and paste it into the Content link in CEWP.
Write the following code shows how to retrieve all of the following sites:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
<html> <head> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript"> var followingManagerEndpoint; var followedCount; var followingEndpoint; var URL; var website; var clientContext; SP.SOD.executeFunc('sp.js', 'SP.ClientContext', loadWebsite); function loadWebsite() { clientContext = SP.ClientContext.get_current(); website = clientContext.get_web(); clientContext.load(website); clientContext.executeQueryAsync(onRequestSucceeded, onRequestFailed); } function onRequestSucceeded() { URL = website.get_url(); followingManagerEndpoint = decodeURIComponent(URL) + "/_api/social.following"; getMyFollowedContent(); } function onRequestFailed(sender, args) { alert('Error: ' + args.get_message()); } // Get the content that the current user is following. // The "types=14" parameter specifies all content types // (documents = 2 + sites = 4 + tags = 8). function getMyFollowedContent() { $.ajax( { url: followingManagerEndpoint + "/my/followed(types=14)", headers: { "accept": "application/json;odata=verbose" }, success: followedContentRetrieved, error: requestFailed }); } // Parse the JSON data and iterate through the collection. function followedContentRetrieved(data) { var stringData = JSON.stringify(data); var jsonObject = JSON.parse(stringData); var types = { 1: "document", 2: "site", 3: "tag" }; var followedActors = jsonObject.d.Followed.results; var followedList = "You're following items:"; for (var i = 0; i < followedActors.length; i++) { var actor = followedActors[i]; followedList += "<p>The " + types[actor.ActorType] + ": \"" +actor.Name + "\"</p>"+"<p>Site URL " + ": \"" + actor.Uri+ "\"</p>";; } $("#Follow").html(followedList); } function requestFailed(xhr, ajaxOptions, thrownError) { alert('Error:\n' + xhr.status + '\n' + thrownError + '\n' + xhr.responseText); } </script> </head> <body> <div id="Follow"></div> </body> </html> |
SharePoint 2013 Hosting Recommendation
HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options

SharePoint 2013 Hosting – HostForLIFE.eu :: How to Set Text Field to Empty or Blank in SharePoint 2013 Designer Workflow
Apr 16th
Here, I’m gonna show you how we can set text field value to empty in SharePoint 2013 designer workflow.
It was a very simple requirement, after sending one email in designer workflow, you need to make a text field to empty in the workflow itself. There is an action available in SharePoint designer workflow name as “Set Field in Current Item”. It is easy to set a field value with another field value using this action, but no direct way to set blank or empty in that action.
So here, you can create a local variable in the workflow with default value of empty and assign that variable to my text field.
Step 1
To create a local variable click on the Local variable button in the Ribbon as shown in the fig below:
Step 2
Then in the Workflow Local Variables dialogbox, click on Add and then give a name and chose the data type as string and then click on OK. Finally the local variable dialog box should look like below:
Step 3
Now add an Action name as Set Field in the current item. Click on the First value link and choose your field name. Then click on the second value link, it will open the Look up dialog box. In the Data Source: choose Workflow Variables and Parameters. Field From Source: Your workflow variable name that we have created above. And Return Field As String as shown in the fig below:
Step 4
Now your full action should look like below:
SharePoint 2013 Hosting Recommendation
HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options.