Showing posts from April, 2018

SharePoint Framework (SPFx) - Adding dynamic values in (SPFx) webpart properties

Hi Friends, We usually have to add the dynamic values to the web part properties. In this blog I will be showcasing the how you can add the dynamic values to the web part properties. In this blog I will showcasing how you can fill in the drop-down values with the Title of the lists. All the lists will be fetched and then will be added to one of the web part properties. On selection of the drop-down you can see the list selected. Step 1 : Create an empty SharePoint project .  To learn how to create SharePoint Framework Project you can refer to my previous post Setup your new SPFx Project . If you have not setup your environment you can refer my blog  3 Steps to Setup your SharePoint Framework Environment . In my case I have crated Project with the name " spfx-dynamic-values-in-web-part-properties " WebPart with the name " demoDynamicValuesInWebP

Useful RegEx patterns

Hi Friends, Today I am not writing something about the SharePoint, but this will be more useful for the client side development. So in many scenarios we need to validate the input string eg valid email address and more. I have found some of the common used validations which we can validate using the regular expressions. I'll be adding more to these as I encounter more and feel free to let me know if you need any more. Commonly used Regular Expressions Title Description Regular Expression Date Time Format Regular expression will match the dates with dashes or slashes or spaces. eg: dd-mm-yyy or dd/mm/yyy and optional time separated by space or dash eg: dd-mm-yyy-hh:mm:ss /^(0?[1-9]|[12][0-9]|3[01])([ \/\-])(0?[1-9]|1[012])\2([0-9][0-9][0-9][0-9])(([ -])([0-1]?[0-9]|2[0-3]):[0-5]?[0-9]:[0-5]?[0-9])?$/ 24 hour time format Regular expression to matches time in 24 hour

Setup your new SPFx Project

Hi Friends, Today I'll be guiding you through a very small step but can be very useful for the beginners. So today i'll be guiding you how to create a new SPFx project so that you can start with the development quickly. To setup the development environment read my post  3 Steps to setup SharePoint Framework Development Environment To setup the new project follow the below steps Open the visual code Create a directory where you would like to create the project Now execute the following command in the terminal (to open press Cntrl + Shift + ~ ) yo @microsoft/sharepoint Then follow the queries and enter the information. Let's create a new SharePoint solution. ? What is your solution name? nameOfYourProject ? Which baseline packages do you want to target for your component(s)? SharePoint Online only (latest) ? Where do you want to place the files? Use the current folder ? Do you want to allow the tenant admin the choice of being able to dep