Posts

HTML field & Date Time formatting in powerapps

Image
Hi All, When i dig around powerapps found an interesting control called HTML field. the potential of this control is enormous based on the scenario lets see couple of examples. 1. Formatting Datetime Go to insert -> Text=>HTML Text Insert the control in the list view Add the below in the formula box Concatenate(" < div style = 'height:100%;width:100%;padding:1px;background-color: #418bca;border-right: 1px solid #fff;float:left;' > < div style = 'position: relative;text-align: center;color: #fff;font-size:20px;padding:0px 3px;' > ",Text(DateTimeValue(Text(Modified)),"dd")," < h4 style = 'margin: 5px 0 0 0;color: #fff;text-align: center;' > ",Upper(Text(DateTimeValue(Text(Modified)),"mmm-yy"))," </ h4 > </ div > ") i.e. Concatenate(" < html > ",Text(DateTimeValue(Text(Modified)),"dd")," < html > ")  Output Note :

Develop Powerapps from the Scratch - Series1/3

Image
Hi All, Hi, Recently I got a chance to work on a couple of high profile PowerApps. I would like to share my experience. Planning to have a series here, this series contain how to  Create, customize and share the powerapp. I am taking product review as the scenario. Lets get started. First things first Setup datasource I am going to use SharePoint list as my datasource. Below is the list schema Title Review Description  Rating Product 1 Some Description 1 5 Product 2 Some Description 2 4 Product 3 Some Description 3 3 Note : click here  for more available connections Build Powerapp from the scratch Go to https://create.powerapps.com/ and authenticate Select a blank app to start it from the scratch Establish connection Go to ribbon and select content->Data Source Then it will list the available services click SharePoint and ente

REST call returns XML instead of JSON in SharePoint

Image
Hi All, enforce REST call to return JSON format instead of #document(XML). $.ajax({         url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/currentuser",         type: "GET",         contentType : "application/json",         headers: { "Accept": "application/json; odata=verbose" },             success: function (data) {                     console.log(data);             custUser = data.d;         },         error: function (error) {             alert(JSON.stringify(error));         }     }); we would get the problematic output like below: add the these lines in "beforeSend" method $.ajax({         url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/currentuser",         type: "GET",         contentType : "application/json",         headers: { "Accept": "application/json; odata=verbose" },         beforeSend: function (XMLHttpRequest) {  

Check current login user permission using JSOM in SharePoint 2013/2016

Hi All, One of the easiest way to check the current logged in user privilege in JSOM if (SP.PageContextInfo.get_webPermMasks().has([26])) {        //your code goes here...   } Below are the list of permission types and it's index.   Permission Type Index emptyMask 0 viewListItems 1 addListItems 2 editListItems 3 deleteListItems 4 approveItems 5 openItems 6 viewVersions 7 deleteVersions 8 cancelCheckout 9 managePersonalViews 10 manageLists 12 viewFormPages 13 anonymousSearchAccessList 14 open 17 viewPages 18 addAndCustomizePages 19