Posts

SPFx Theme Color Values

"theme" : {      "palette" :  {        "themeDarker" :   "#004578" ,        "themeDark" :   "#005a9e" ,        "themeDarkAlt" :   "#106ebe" ,        "themePrimary" :   "#0078d4" ,        "themeSecondary" :   "#2b88d8" ,        "themeTertiary" :   "#71afe5" ,        "themeLight" :   "#c7e0f4" ,        "themeLighter" :   "#deecf9" ,        "themeLighterAlt" :   "#eff6fc" ,        "black" :   "#000000" ,        "blackTranslucent40" :   "rgba(0,0,0,.4)" ,        "neutralDark" :   "#201f1e" ,        "neutralPrimary" :   "#323130" ,        "neutralPrimaryAlt" :   "#3b3a39" ,        "neutralSecondary" :   "#605e5c" ,        "neutralSecondaryAlt" :   "#8a8886"

JavaScript Tips and Tricks - I

Image
I decided to write a series of coding tips and tricks that I follow while writing my code. This series will help Javascript developers to have a good judgement when to use them and helps to build a quality application. Now, let's jump into the first one. Ternary Operator: It is commonly referred to as the conditional operator , inline if (iif) , or ternary if . I personally use this one in most of my codes. Before jumping into how to use them, let study why to use them. when you write an if block, first you declare the variable outside the if block, so that you can use them after the if block. So a simple condition takes a two-block.   Block 1 for variable assignment and Block 2 for executing the condition.   A minimum of 6 to 7 lines of code required. Let's see how ternary operator makes it more concise.  The conditional (ternary) operator is the only JavaScript operator that takes three operands: a condition followed by a question mark (?), then an expression to execute if t

Save Location details to SharePoint Location column through SPFx and PnP JS

Image
The Location field in SharePoint has been announced in February 2019 - ( https://techcommunity.microsoft.com/t5/sharepoint/add-location-details-to-sharepoint-data-and-content/m-p/284875 ). Before this announcement, data has been saved as addresses and coordinates(Latitude, Longitude) in different columns in SharePoint because if they have to be filtered by address, city, or state.    The data of the location column is saved with all these details: Image 1 If you want to save only the coordinates, you can pass only that value to the location column while saving the item. If you want to save, only the address like city, country and Pincode, you can pass only those values to the location column. I initially thought because it is a location column you have to pass the coordinates for saving. But, there is no mandatory value that needs to be passed to save the value for the location column and that is really useful.  Save Location Details through SPFx/PnP JS: In this example, I am going to