Category Archives: Javascript

How to Convert Array of Objects into Comma Separated String extracting only one property

Hi, I’d like to share a quick solution which always is really useful when you are handling complex object-type data structures in JavaScript / ES6 / TypeScript. That code will be useful when you want to extract some property values from an array of objects. I will share two versions one for EcmaScript 5 and Read More →

TypeScript functions to convert from Base64 to UTF8 and vice versa

Hi, Few days ago I wrote a post about uploading JSON object using JavaScript. There are some dependencies using this approach, which are b64EncodeUnicode and b64DecodeUnicode functions. I’d like to share how to write these functions using TypeScript:   Enjoy! @jquintozamora

Upload JSON Object as a File into OFfice 365 using JavaScript (JSOM)

Hi, In this post, I am going to show how to convert and upload a JSON Object into a SharePoint library using JavaScript Client Object Model. That approach will be valid using the code inside a SharePoint Web Part, will not be valid for SP Apps or JavaScript applications running outside of SharePoint context. Here Read More →

Getting React to Load polyfills only when needed

As a front-end developer, providing support to different browsers and devices isn’t an easy task. In fact, it’s the trickiest part of web development because there are differences in terms of HTML, CSS and JavaScript functions supported for every browser / device. There are quite good web sites documenting these differences in terms of: – Read More →

Update Page Layout by using JavaScript (JSOM) in Office 365

  Hi, I’m going to show how to update or change the page layout for a given SharePoint page. That sounds quite straightforward, but we have to mind some important bits: – Check in, check out status of the current page or item we are changing. – CAML query using Page Layout as a FieldRef Read More →

Cross-Browser and Device Testing with BrowserStack, Nightwatch and Office 365 Authentication

Hi there, Recently I was working on a project with lots of Responsive pages to do. One of the main requirements was enabling Responsive experience in an Office 365 intranet, in fact the most used device on that company was iPhone 5S. Then I started developing using Media Queries, initially building a responsive menu. Initially Read More →

React: Use ES6 arrow functions in Classes TO avoid binding your methods with the current This object

Hi, Working with React sometimes, if you like well-organized and structured code, you will be in the situation to have to do things like: this.minus = this.minus.bind(this); We can avoid having to bind every method by using ES6 arrow functions inside of the class methods. That means that we need to use the babel plugin Read More →

A beginner’s guide to build a new SPA with ES6, SCSS, React, Webpack and HMR.

Recently, I have been working on a project which used ReactJS to build several SPAs (Single Page Applications). I’ll openly admit it was a pain for me to get working even a basic project or starter template. The reason is because there are lots of new concepts, frameworks and technologies. I decided to write down Read More →

CAML Query to Filter Lookup Field by Id using JSOM in Office 365 / SharePoint 2013

Hi, Few days ago, I wrote a post about how to Create a new lookup field using JSOM in Office 365. Continuing with the same scenario, we have two related libraries: Documents and Pages, and the requirement is to see for every page one list of related documents. So, the first step, was creating a Read More →

Retrieve Static and Internal Field Names of a SharePoint List using JavaScript in Office 365

Hi, There are scenarios where we need to show and compare Internal and Static field names of a SharePoint list. For instance, if we want to do CAML query over some custom fields, but we don’t remember exactly the Internal Name of the field, we can use this code directly copied and pasted in the Read More →