<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>IdeaMovers</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ideamovers/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ideamovers/feed.xml</link>
    <description>Floating Ideas Around - Catch the Flow!</description>
    <lastBuildDate>Tue, 16 Apr 2019 06:09:28 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How to configure Code to connect to Visual Studio Online</title>
      <link>https://docs.microsoft.com/archive/blogs/ideamovers/how-to-configure-code-to-connect-to-visual-studio-online</link>
      <pubDate>Fri, 24 Nov 2017 14:12:12 GMT</pubDate>
      <dc:creator><![CDATA[Tony Cantu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ideamovers/?p=285</guid>
      <description><![CDATA[In this quick article I am going to walk through the process of getting Visual Studio Code (Code) to...]]></description>
      <content:encoded><![CDATA[In this quick article I am going to walk through the process of getting Visual Studio Code (Code) to connect to Visual Studio Online(VSO). Visual Studio Online allow us to build our team, without borders, and help us manage versioning, source control, and so much more. As for my customer and I, we will use it for CSR in SharePoint and write a few PowerShell scripts to help manage the SharePoint farm.

@Code, from twitter, helped me get started on the right track and I also used the following documentation to get me started:

<a target="_blank" href="https://docs.microsoft.com/en-us/vsts/git/share-your-code-in-git-cmdline" rel="noopener">https://docs.microsoft.com/en-us/vsts/git/share-your-code-in-git-cmdline </a>

I did not, however, follow it completely as I ended up doing a few things differently and in a different order. However,  I thank those guys for giving me something to follow.

There are a few assumptions that i make. One, that you have downloaded and installed Code, that you have installed the Visual Team Studio Services Extension, and that you have a subscription to VSO. I will not be going into those subjects here.

So let's get started!
<h3><span style="color: #00ccff">Create New Project</span></h3>
The first thing you should do is navigate to VSO, login and head over to Projects. Once there, click on "New Project", wait for it to load and create  a new <strong>Git Team Project</strong>. Make sure you select Git as the Version Control as it is a requirement for this article. Once you have filled in all the information click on "Create".

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/VSO-New-Project.png" rel="noopener"><img width="400" height="357" class="aligncenter wp-image-486 size-medium" alt="Create a new Git Project in Visual Studio Online" src="https://msdnshared.blob.core.windows.net/media/2017/11/VSO-New-Project-400x357.png" /></a>

&nbsp;

The image below is of a newly created project in VSO. While here, you are going to need the URL of your project repository. Save it somewhere or just copy it into a text file and save it to your desktop for later use.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/VSO-Project-Created1.png" rel="noopener"><img width="400" height="239" class="aligncenter wp-image-505 size-medium" alt="New Git Project in Visual Studio Online" src="https://msdnshared.blob.core.windows.net/media/2017/11/VSO-Project-Created1-400x239.png" /></a>

&nbsp;

Now we need to make sure that you have Alternate Authentication Credentials configured in VSO. This is so that Git can access the repository. Git cannot login to VSO like you are able to, with email and password. Because of this, we need to configure Alternate Authentication Credentials.

The need to configure Alternate Authentication Credentials has nothing to do with Code or how it connects to VSO. This is simply so that Git can connect to VSO and replicate your repository locally to your computer.
<ul>
 	<li>In VSO, mouse over your profile avatar and click on "Security"</li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2017/11/VSO-Security.png"><img width="400" height="216" class="aligncenter size-medium wp-image-525" alt="Security under Profile" src="https://msdnshared.blob.core.windows.net/media/2017/11/VSO-Security-400x216.png" /></a>
<ul>
 	<li>Fill out the information if it is empty. Make sure you log these new credentials somewhere. We will need it shortly in the tutorial.</li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2017/11/VSO-Alternate-Authentication.png"><img width="400" height="124" class="aligncenter wp-image-475 size-medium" alt="Alternate Authentication Credentials" src="https://msdnshared.blob.core.windows.net/media/2017/11/VSO-Alternate-Authentication-400x124.png" /></a>

&nbsp;
<h3><span style="color: #00ccff">Download and Install Git</span></h3>
First, what is Git and why do I need it?

Git is a version control system. It helps you manage small and large projects. For us, it is what allows us to communicate with VSO and most importantly it allows Code to communicate with VSO.

Download and install Git from: <a target="_blank" href="https://git-scm.com/download/" rel="noopener">https://git-scm.com/download/</a>

Once downloaded, double click the downloaded file to start the installation. For this installation, I selected the default settings for just about every step in the installation process (with one exception). You can modify the installation however you want or just follow along.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Select-Destination.png" rel="noopener"><img width="400" height="298" class="aligncenter wp-image-435 size-medium" alt="Select where to install Git" src="https://msdnshared.blob.core.windows.net/media/2017/11/Select-Destination-400x298.png" /></a>

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Select-Components.png" rel="noopener"><img width="400" height="298" class="aligncenter wp-image-425 size-medium" alt="Select Components of the Git installation" src="https://msdnshared.blob.core.windows.net/media/2017/11/Select-Components-400x298.png" /></a>

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Select-Start-Menu.png" rel="noopener"><img width="400" height="297" class="aligncenter wp-image-445 size-medium" alt="Select Start Menu of the Git installation" src="https://msdnshared.blob.core.windows.net/media/2017/11/Select-Start-Menu-400x297.png" /></a>

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Path-Environment.png" rel="noopener"><img width="400" height="299" class="aligncenter wp-image-416 size-medium" alt="Path Environment for the Git installation" src="https://msdnshared.blob.core.windows.net/media/2017/11/Path-Environment-400x299.png" /></a>

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/https-transport.png" rel="noopener"><img width="400" height="295" class="aligncenter wp-image-397 size-medium" alt="https options of the Git installation" src="https://msdnshared.blob.core.windows.net/media/2017/11/https-transport-400x295.png" /></a>

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Line-Ending.png" rel="noopener"><img width="400" height="299" class="aligncenter wp-image-406 size-medium" alt="Line ending options of the Git installation" src="https://msdnshared.blob.core.windows.net/media/2017/11/Line-Ending-400x299.png" /></a>

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Terminal-Emulater.png" rel="noopener"><img width="400" height="297" class="aligncenter wp-image-455 size-medium" alt="Terminal Umilater options of the Git installation" src="https://msdnshared.blob.core.windows.net/media/2017/11/Terminal-Emulater-400x297.png" /></a>

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Extra-Options.png" rel="noopener"><img width="400" height="296" class="aligncenter wp-image-385 size-medium" alt="Extra Options of the Git installation" src="https://msdnshared.blob.core.windows.net/media/2017/11/Extra-Options-400x296.png" /></a>

You should now have Git installed on your computer. Let's get it communicating with our VSO project, shall we?
<h3><span style="color: #00ccff">Setup Git Locally</span></h3>
Create a folder on your local hard drive. You can use the Git terminal to create the folder structure but for simplicity I used File Explorer. <span style="float: none;background-color: transparent;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;line-height: 24px;text-align: left;text-decoration: none;text-indent: 0px">If you are following my example, I used C:\Scripts.  Now o</span>pen, if it isn't already, the Git Bash Terminal and navigate to the newly created folder by typing the following command (notice that I have removed my computer name from the image. Yours will be prefixed with your computer name):
<pre>cd c:\Scripts</pre>
<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/navigate-to-folder.png" rel="noopener"><img width="400" height="237" class="aligncenter wp-image-405 size-medium" alt="Git: navigate to folder" src="https://msdnshared.blob.core.windows.net/media/2017/11/navigate-to-folder-400x237.png" /></a>
Now that we are in the folder that we want to be working on we want to clone our VSO Repository into it. Run the following commands:
<ul>
 	<li>
<pre>git init</pre>
<ul>
 	<li>This initializes Git in the folder you are currently in. If you navigate to that folder after running the command, in my case c:\Scripts, you should see a new ".git" folder.</li>
</ul>
</li>
 	<li>
<pre>git config --global user.name "Your Name"</pre>
<ul>
 	<li>This is the information you created in the steps above where you set up Alternate Authentication Credentials.</li>
</ul>
</li>
 	<li>
<pre>git config --global user.password "your password"</pre>
<ul>
 	<li>This is sent to VSO using SSL in the step below</li>
</ul>
</li>
 	<li>
<pre>git clone &lt;URL to your repository&gt;</pre>
<ul>
 	<li>This will clone your VSO repository to your local machine. Specifically in the folder you are currently in. In my example I was in "C:\Scripts". My VSO Repository is "CSR". To make sure it all worked correctly navigate to C:\Scripts and make sure you now have a new folder with the name of your VSO Repository. What mine looks like: c:\Scripts\CSR.</li>
</ul>
</li>
</ul>
<h3><span style="color: #00ccff">Test the configuration in Visual Studio Code</span></h3>
Launch Code and open the folder that holds your VSO Repository. In my case I am opening "CSR" in "C:\Scripts". If you have the Visual Studio Team Services extension installed in Code it will immediately recognize the repository and give you the functionality you need to use VSO with Code.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Open-Folder.png" rel="noopener"><img width="400" height="203" class="aligncenter wp-image-325 size-medium" alt="Visual Studio Team Services extension" src="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Open-Folder-400x203.png" /></a>
It is all looking good if Code is working for you like it is for me. Now I believe it is time to test this idea of using VSO with Code. Notice in the screenshot above there are no files in the "CSR" folder. We will create a new .js file and move it over to VSO.

Let's start by creating the file. I will name mine "test.js". Yes, very original. Notice that Code immediately recognizes the file is not being tracked. This means that the file has neither been committed locally or pushed to VSO. The "U" on the far right stands for "Untracked" <span style="float: none;background-color: transparent;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;line-height: 24px;text-align: left;text-decoration: none;text-indent: 0px">(image below)</span>.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-New-File.png" rel="noopener"><img width="400" height="293" class="aligncenter wp-image-315 size-medium" alt="New JavaScript file" src="https://msdnshared.blob.core.windows.net/media/2017/11/Code-New-File-400x293.png" /></a>

Now open the "Command Palette" from the ribbon in Code. Go to View --&gt; Command Palette. In the Command Palette box enter "team" and select "Team: Signin" to sign in to VSO (image below).

<a href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Team-Signin.png"><img width="400" height="134" class="aligncenter size-medium wp-image-365" alt="Code Team Signing" src="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Team-Signin-400x134.png" /></a>
At this point you are presented with two options to login to your VSO subscription:
<ul>
 	<li>Option 1: Provide an access token manually (current experience)
<ul>
 	<li>If you already have an access token, use this option. Using this options means that you got your Access Token from VSO. I won't go into much detail here but if you look up a few steps, to where you set up the Alternative Authentication Credentials you will see the option to create an Access Token.</li>
</ul>
</li>
 	<li>Option 2: Authenticate and get an access token automatically (new experience)
<ul>
 	<li>If you do not have an Access Token yet, select this option and follow the instructions. Code will walk you through the entire process.</li>
</ul>
</li>
</ul>
<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Authenticate-Signin.png" rel="noopener"><img width="400" height="112" class="aligncenter wp-image-287 size-medium" alt="Code Signing to Visual Studio Online" src="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Authenticate-Signin-400x112.png" /></a>

Make sure to follow the directions completely. Code will give you a random access token that will be required in the next few steps. If you go away from Code during any point in this process you will have to start again as the token will fail to exist.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Authenticate-2-Signin.png" rel="noopener"><img width="400" height="109" class="aligncenter wp-image-496 size-medium" alt="Access Token" src="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Authenticate-2-Signin-400x109.png" /></a>

After copying the random code highlighted in blue, hit enter. A browser window will open up where you will have to enter the code.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Device-Login.png" rel="noopener"><img width="400" height="193" class="aligncenter wp-image-306 size-medium" alt="Code-Device-Login" src="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Device-Login-400x193.png" /></a>

Enter the code in the form field. This will display two new buttons.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Device-Login-2.png" rel="noopener"><img width="342" height="400" class="aligncenter wp-image-296 size-medium" alt="Code-Device-Login" src="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Device-Login-2-342x400.png" /></a>

Click on Continue. After you click on continue you will have to login to VSO. This is where you enter your email and password to your VSO subscription.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Signin-to-Microsoft.png" rel="noopener"><img width="400" height="354" class="aligncenter wp-image-345 size-medium" alt="Code-Device-Login" src="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Signin-to-Microsoft-400x354.png" /></a><a href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Device-Login-2.png"></a>

At the end, you will receive a confirmation that you have successfully logged into VSO and in doing so have bridged together Code and VSO.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-You-have-signed-in.png" rel="noopener"><img width="400" height="265" class="aligncenter wp-image-375 size-medium" alt="Code-You-have-signed-in" src="https://msdnshared.blob.core.windows.net/media/2017/11/Code-You-have-signed-in-400x265.png" /></a>

Once you are signed in, go back to Code and try to commit the new file that was created. Click on the Source control icon. In our example, I am pointing at it with a red arrow. 

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Source-Control.png" rel="noopener"><img width="400" height="358" class="aligncenter wp-image-355 size-medium" alt="Code Source Control Extension" src="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Source-Control-400x358.png" /></a>

Then Commit the changes.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Commit-changes.png" rel="noopener"><img width="400" height="190" class="aligncenter wp-image-536 size-medium" alt="Code-Commit-changes" src="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Commit-changes-400x190.png" /></a>

Now "Push" the changes to VSO by clicking on the three dots (...) and click on "Push".

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Push.png" rel="noopener"><img width="400" height="236" class="aligncenter wp-image-335 size-medium" alt="Code-Push" src="https://msdnshared.blob.core.windows.net/media/2017/11/Code-Push-400x236.png" /></a>

The file, in our case "test.js" will shows up in VSO.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/11/VSO-JavaScript.png" rel="noopener"><img width="400" height="89" class="aligncenter wp-image-485 size-medium" alt="VSO-JavaScript" src="https://msdnshared.blob.core.windows.net/media/2017/11/VSO-JavaScript-400x89.png" /></a>

We have successfully connected VSO with Code.

If you have any questions or need clarification on any of the steps, feel free to reach out to me.

Thanks!]]></content:encoded>
    </item>
    <item>
      <title>Using Chart.js with REST in SharePoint 2013</title>
      <link>https://docs.microsoft.com/archive/blogs/ideamovers/using-chart-js-with-rest-in-sharepoint-2013</link>
      <pubDate>Thu, 03 Aug 2017 09:07:36 GMT</pubDate>
      <dc:creator><![CDATA[Tony Cantu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ideamovers/?p=266</guid>
      <description><![CDATA[[caption id="attachment_276" align="aligncenter" width="1024"] Task by Percent...]]></description>
      <content:encoded><![CDATA[[caption id="attachment_276" align="aligncenter" width="1024"]<img src="https://msdnshared.blob.core.windows.net/media/2017/08/Graph-1024x515.png" alt="Task by Percent Completed" width="1024" height="515" class="size-large wp-image-276" /> Task by Percent Completed[/caption]


In a previous post I wrote about how to include Chart.js into a SharePoint page. Chart.js is a great tool to chart data. In the first blog the data was constant and hard coded into the script. In this article I include data that is a bit more dynamic, data that is in motion, data that is a bit more SharePoint-like-- a SharePoint Task List. 

I will also introduce three new concepts: REST, jQuery and JSLink. When you combine REST and JSLink magic happens inside of SharePoint. It's like fizz in a soft drink, like gun powder inside the firecracker, like.. well you get the point- magic happens! 

To get introduced to both concepts you can find information in the following links:

	<ul>
<li><a href="https://social.technet.microsoft.com/wiki/contents/articles/29764.sharepoint-2013-an-introduction-to-jslink.aspx" target="_blank">SharePoint 2013 : An Introduction to JSLink</a></li>

	<li><a href="https://msdn.microsoft.com/en-us/library/office/jj860569.aspx" target="_blank">REST API reference and samples</a></li></ul>


This articles picks up where the other one left off so I am not going to spend time configuring the page and setting up the libraries. You can go back to Using Chart.js in SharePoint 2013 if you have not done so just yet. 

In my previous post, the JavaScript was simple and easy. After all, Chart.js is the one that is doing all the heavy lifting. The JavaScript looked like this:



The new version of this script looks similar when it comes to Chart.js. As a matter of fact, the only thing that changes is the dataset that gets build dynamically and the colors that I use in the chart. To begin creating our dataset I use the jQuery.ajax() call to query the Task List I am working with.

<code>$.ajax({
	url:"/_api/Web/Lists/getbytitle('task%20list%20example')/items?$select=Title,Status,PercentComplete",
	type: "GET",
	headers: {
		"Accept": "application/json;odata=verbose"
	},
	success: successHandler,
	error: errorHandler
});</code>

Although the $.ajax() call above is full of nuggets (and I will walk through as many as I can), the key point to take from the above code is that the jQuery.ajax() call is an asynchronous request to my task list. What is Ajax? Ajax stands for Asynchronous JavaScript and XML. Its main function is to load and display data in the background without reloading the entire page. In other words, the function is doing is thing in the background… while everything else loading and rendering. Kind of cool, eh?

Enter REST endpoints. If you were to take the above REST Endpoint and drop in the URL bar of your browser, you should get back some information. In fact, that is one sure way to make sure that you are getting back the data you need. If the page that comes back doesn't have the data you need, then you need to modify your request. In my request above, I use a select statement to get me what I need, in this case I just need the "Title", "Status", and "PercentComplete" fields.

<code>$select=Title,Status,PercentComplete"</code>

Like most http request, we are setting the "Type" as a "Get"  request: 

<code>type: "GET"</code>

I am also setting the headers to return the data we need in JSON (JavaScript Object Notation) format. This means that our data will come back to us as a collection of Name/Values pairs. 

<code>headers: {
"Accept": "application/json;odata=verbose"
},</code>

Finally we have the functions that are called depending on the success of the $.ajax() call:

<code>success: successHandler,
error: errorHandler</code>

I am only going to concentrate on the successHandler() function because this is where I manipulate the data to fit the needs that Chart.js requires. Not to be left behind, however, the errorHandler() function is an important function as well. You can do a lot of things, and you should, if your request happens to fail. 

Let's get started on the successHandler().

<code>function successHandler(data){
	var myDataSet = data.d.results;
	var myLabels = [];
	var myData = [];
	$(myDataSet).each(function()
	{
		myLabels.push(this.Title);
		myData.push((this.PercentComplete * 100));
	});
	myData.push(0); // creates a '0' index on the graph</code>

To start, as already mentioned, the successHandler() function is only called when the $.ajax() call is successful. This means that the request was able to query the REST endpoint and now has a result set, a collection of the data we requested. This collection, this data is then passed to the successHandler() function in the way of the "data" parameter. 

<code>function successHandler(data){</code>

Because the data collection that we get back from the server has a lot of metadata we are not going to use we have to drill into the collection and get only what we need. Because of this I declare a variable that will hold the Name/Value pairs I need.

<code>var myDataSet = data.d.results;</code>

If you  look closely at the first article or the Chart.js documenation, it requires an array that hold the values for the "Labels" and the "Data" that will be graphed. Because of this we declare two new arrays, name them accordingly and start populating them by looping through the data collection. 

<code>var myLabels = [];
var myData = [];
$(myDataSet).each(function()
{
	myLabels.push(this.Title);
	myData.push((this.PercentComplete * 100));
});
myData.push(0); // creates a '0' index on the graph</code>

Now that we have our arrays populated we need to instruct Chart.js to use them. To do this, I first have to get the canvas that Chart.js uses to create the graphs. Again, this information will be found on the previous blog. We also tell Chart.js what type of graph we are looking to create. In this example we are using the bar graph. 

<code>var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {

// The type of chart we want to create
type: 'bar',</code>

In the following code, there are three things that I will cover. These three settings are what make Chart.js do what it does. In a nutshell we assign <code>myLabels</code> (our custom array that we created and populated above) to <code>labels</code>. We create a title for our graph by setting the label setting: <code>label: "Task by Percent Completed"</code>. We set the colors that each bar will use, also an array and finally we assign <code>myData </code>array to the <code>data </code>setting. 

<code>data: {
	labels: myLabels,
	datasets: [{
	label: "Task by Percent Completed",
	backgroundColor: ['rgb(255, 0, 0)','rgb(0,0,255)','rgb(0,255,0)','rgb(255,0,255)','rgb(255,255,0)','rgb(0,255,255)','rgb(127,0,255)'],
	borderColor: 'rgb(0, 0, 0)',
	data: myData,
	}]
},</code>

After it is all said and done, you should have created a graph using data from a SharePoint list. The complete code is below:

<code>$.ajax({
    url:"https://army.deps.mil/NETCOM/sites/106SB/SharePointTraining/ms/_api/Web/Lists/getbytitle('task%20list%20example')/items?$select=Title,Status,PercentComplete",
    type: "GET",
    headers: {
        "Accept": "application/json;odata=verbose"
    },
    success: successHandler,
    error: errorHandler
});</code>

<code>function successHandler(data){
    var myDataSet = data.d.results;
        var myLabels = [];
        var myData = [];
        $(myDataSet).each(function()
        {
            myLabels.push(this.Title);
            myData.push((this.PercentComplete * 100));
        });
        myData.push(0); // creates a '0' index on the graph</code>

<code>    var ctx = document.getElementById('myChart').getContext('2d');
    var chart = new Chart(ctx, {
        // The type of chart we want to create
        type: 'bar',</code>
<code>
        data: {
            labels: myLabels,
            datasets: [{
                label: "Task by Percent Completed",
                backgroundColor: ['rgb(255, 0, 0)','rgb(0,0,255)','rgb(0,255,0)','rgb(255,0,255)','rgb(255,255,0)','rgb(0,255,255)','rgb(127,0,255)'],
                borderColor: 'rgb(0, 0, 0)',
                data: myData,
            }]
        },</code>

<code>        // Configuration options go here
        options: {}
    });
};</code>



 






]]></content:encoded>
    </item>
    <item>
      <title>Using Chart.js in SharePoint 2013</title>
      <link>https://docs.microsoft.com/archive/blogs/ideamovers/using-chart-js-in-sharepoint-2013</link>
      <pubDate>Wed, 12 Jul 2017 13:36:10 GMT</pubDate>
      <dc:creator><![CDATA[Tony Cantu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ideamovers/?p=175</guid>
      <description><![CDATA[Chart.js
At the time of this writing the version of Chart.js is 2.6.0. You can go to GitHub and...]]></description>
      <content:encoded><![CDATA[<h2><span style="color: #00ccff"><strong>Chart.js</strong></span></h2>
At the time of this writing the version of Chart.js is 2.6.0. You can go to <a target="_blank" href="https://github.com/chartjs/Chart.js/releases/tag/v2.6.0" rel="noopener noreferrer">GitHub</a> and download the latest version. For testing purposes, our purpose for today, I am only working with Chart.min.js. You, however, are free to download everything if you like. If you are just starting out, it would be beneficial to download the files that include some sample code.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/07/GitHubDownload.png" rel="noopener noreferrer"><img border="1px" width="300" height="115" class="alignnone wp-image-195 size-medium" alt="GitHub Site Displaying Chartjs files" src="https://msdnshared.blob.core.windows.net/media/2017/07/GitHubDownload-300x115.png" /></a>

Once downloaded, be sure to upload Chart.min.js to a document library in your site collection or site. I won't go into details of where this file can go in your SharePoint farm. Company policy, best practice, and user permissions should all play a role in your decision of which document library the file should be uploaded to. For this example, and it is my preference only, I created a 'js' document library that holds all of my JavaScript files. Easy to use, easy to find.

Also, for the purpose of this tutorial, we will be using the 'Getting Started' section of the Chart.js Documentation. I have opened Visual Studio Code, an exceptional and well written editor, and have created the following file and named it 'chartJS.js':

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/07/code.png" rel="noopener noreferrer"><img width="300" height="154" class="alignnone wp-image-215 size-medium" alt="ChartJS Sample Code" src="https://msdnshared.blob.core.windows.net/media/2017/07/code-300x154.png" /></a>

The above image simply combines the code in the Chart.js Documentation into one file that I uploaded to the 'js' document library. The only thing you need to worry about here is that you have to make sure that the first line, "…/js/Chart.ms.js' actually points your 'Chart.ms.js' file. Notice on the image above that mine points to the '/js' document library. This correlates with the steps above.

Once you have created this file, save it with the '.js' file extension and because it has a '.js' file extension, it will go in the 'js' document library.

To recap, you should have at least two (2) new '.js' files in your document library. For me, that would be my 'js' document library.
<p>&nbsp;</p>
<h2><span style="color: #00ccff"><strong>SharePoint Page</strong></span></h2>
Once Chart.min.js has been uploaded to your document library it is time to work with the SharePoint page that will hold the content and eventually display the chart(s).

Create a new page in the 'Site Pages' document library. The type of page doesn't really matter here but I will be using the 'Web Part Page'. The 'Web Part Page' looks like the image below:

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/07/WebPartPage.png" rel="noopener noreferrer"><img width="300" height="129" class="alignnone wp-image-205 size-medium" alt="The Web Part Page in Edit Mode" src="https://msdnshared.blob.core.windows.net/media/2017/07/WebPartPage-300x129.png" /></a>

To create the page navigate to the 'Site Pages' gallery, go to the ribbon and click 'Pages'. Then 'View All Pages.' In the ribbon click 'New Document' and from the drop-down choose 'Web Part Page.'

<p>&nbsp;</p>
<h2><strong><span style="color: #00ccff">HTML-ing, SharePoint-ing, JavaScript-ing</span></strong></h2>
(whatever you would like to call it)
Now that we have our page ready to go, we will start working with the code. This task can be accomplish in multiple ways. The one we are going to use for this example will free us to be a bit more versatile when it comes to reusing the file we just created.

To get started we are going to need the 'Content Editor' Web Part. If your page is not in edit mode, you will need it to be. Once in Edit Mode, click on the 'Add a Web Part' link of the 'Header' Web Part Zone. In the 'Categories' section navigate down to 'Media and Content'. In the 'Parts' section select the 'Content Editor' Web Part and click on the 'Add' button on the bottom right.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/07/ContentEditor.png" rel="noopener noreferrer"><img width="300" height="60" class="alignnone wp-image-225 size-medium" alt="Adding the Content Editor Web Part" src="https://msdnshared.blob.core.windows.net/media/2017/07/ContentEditor-300x60.png" /></a>


The 'Header' Web Part Zone should now have a new Web Part with the title 'Content Editor'.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/07/Header.png" rel="noopener noreferrer"><img width="300" height="74" class="alignnone wp-image-196 size-medium" alt="Display the Header Web Part Zone" src="https://msdnshared.blob.core.windows.net/media/2017/07/Header-300x74.png" /></a>

Now we need to add the chartJS.js file to the 'Content Editor' Web Part. Mouse over the far right hand side of the 'Content Editor' Web Part to get the Web Part menu to display. It will only display if you mouse over the down arrow next to the check box. Click on 'Edit Web Part' in the menu.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/07/EditWebPart.png" rel="noopener noreferrer"><img width="300" height="115" class="alignnone wp-image-185 size-medium" alt="Edit SharePoint Web Part" src="https://msdnshared.blob.core.windows.net/media/2017/07/EditWebPart-300x115.png" /></a>


The page will reload and display the Web Part Property window to the far right of the page.

<a target="_blank" href="https://msdnshared.blob.core.windows.net/media/2017/07/ContentEditorProperties.png" rel="noopener noreferrer"><img width="300" height="90" class="alignnone wp-image-235 size-medium" alt="Properties of the Web Part" src="https://msdnshared.blob.core.windows.net/media/2017/07/ContentEditorProperties-300x90.png" /></a>


In the 'Content Link' section of the 'Content Editor' enter the URL to your file-- the chartjs.js file that we created in the beginning. In our example it would be '../js/chartjs.js'. Once you have added the URL to the file, you can click on the 'Test Link' to make sure that SharePoint can find the file. If SharePoint can find the file, it will either open the file in your browser or prompt you to download it. If SharePoint can’t find your file it means you have the URL wrong. Work with it until SharePoint can see it. Click on the 'OK' Button

Once the page finishes rendering, you should be able to see the demo content display. Save your file, Check it in and Publish it so that everyone can see your test demo!]]></content:encoded>
    </item>
    <item>
      <title>Some or all identity references could not be translated.</title>
      <link>https://docs.microsoft.com/archive/blogs/ideamovers/some-or-all-identity-references-could-not-be-translated</link>
      <pubDate>Sun, 23 Apr 2017 08:58:34 GMT</pubDate>
      <dc:creator><![CDATA[Tony Cantu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ideamovers/?p=145</guid>
      <description><![CDATA[What is the Managed Accounts feature? What are Managed Accounts? A TechNet article on SharePoint...]]></description>
      <content:encoded><![CDATA[What is the Managed Accounts feature? What are Managed Accounts? A <a href="https://technet.microsoft.com/en-us/library/ff724280.aspx">TechNet</a> article on SharePoint 2013 Managed Accounts describes what managed accounts are/is: "Automatic password change enables SharePoint 2013 to automatically generate long, cryptographically-strong passwords on a schedule that you can determine." In essence, the Managed Account feature enables SharePoint to modify the password(s) of a domain service account(s) that is being used by SharePoint before the password expires.

&nbsp;

<strong>Symptoms</strong>
You get the error "Some or all identity references could not be translated" when trying to browse to Configure Service Accounts in Central Administration.

&nbsp;

<img width="584" height="265" class="alignnone wp-image-155 size-full" alt="Some or all identity references could not be translated" src="https://msdnshared.blob.core.windows.net/media/2017/04/ConfigureServiceAccountsPageError.png" />

&nbsp;

From the ULS logs, you can see the following:

<code>System.Security.Principal.IdentityNotMappedException: Some or all identity references could not be translated</code>

&nbsp;

<strong>Cause</strong>
In our case, for some reason, SharePoint was unable to resolve one or more managed accounts with Active Directory. A good percentage of the time, the associated AD account has been deleted or modified, but the managed account is not.

&nbsp;

<strong>Resolution</strong>
Open SharePoint 2010 Management Shell with administrative privileges. To identify the affected account, run:

<code>Get-SPManagedAccount</code>

You should see one or more accounts without an entry in the "PasswordExpiration" column. I found two of them. To get things moving again, you have to remove the account(s) off of SharePoint so it doesn't try to manage them.

<code>$ma = Get-SPManagedAccount &lt;account&gt;
$ma.Delete()</code>

Have Fun SharePoint-ing!]]></content:encoded>
    </item>
  </channel>
</rss>