Skip to main content

Posts

Chapter 3 - GraphAPI Calendar Events Demo

Create a folder CreateAPIEventsDemo and create react webpart install types for graph api as below. which adds dev dependencies to our JSON files. "npm install @microsoft/microsoft-graph-types --save-dev" now go to components-.ts file  We are adding context  context : WebPartContext ------------------------------------------- Created a new file in components folder ICalendarEventsState.ts import   *   as   MicrosoftGraph   from   '@microsoft/microsoft-graph-types' ; export   interface   ICalendarEventsDemoState {      events : MicrosoftGraph . Event []; } We have created ICalendarEventsDemoState interface with events as property with array of events from MicrosoftGraph. for our convenience we import graphapi types  import   *   as   MicrosoftGraph   from   '@microsoft/microsoft-graph-types' ; ---------------- In Main.ts file public   render ():  void  {      c...

Creating SharePoint List with columns and content types using Power Automate Flow

 Rest API Uri: https://gitbrent.github.io/SpRestLib/blog/2018/04/20/create-sharepoint-list-columns-using-rest.html Create SharePoint List: site address: Enter URL method: Post URi: /_api/web/lists headers: Accept:application/json;odata=verbose Content-Type:application/json;odata=verbose Body: {   "__metadata": {"type": "SP.List"},   "AllowContentTypes": true,   "BaseTemplate": 100,  "Description": "Admin configuration list",  "Title": "AdminConfigList" } -------------------------------------------------------------------------------------- Multi line text field: create a multiline text column: Site URL: Target Site URi: _api/lists/getbytitle('CI_CompanyNews')/fields Type: POST Body: {     '__metadata': {'type':'SP.Field', 'addToDefaultView': 'true' },     'FieldTypeKind': 3,     'Title': 'Blurb' } Headers:  Accept:application/...

Power Apps Patch method for Multiselect people picker field

I have text box field in power app canvas app where I would like to populate office 365 users in search. We have enabled multiple users selection. Connect office 365 users in datasources items: Office365Users.SearchUser({searchTerm:cbusername.SearchText,top:10}) Here, cbusername is the text box field name while doing patch, we want to save it in SP List. Refer this video:  https://www.youtube.com/watch?v=bmft4JFWJiY In the below example, I am using Office 365 users in textbox named "cbusername" and "cbapproversnames". First using ForAll loop for office 365 users connected text box, Inside creating a collection and assigning ThisRecord.Mail ... values to the collection. ForAll(             cbusername.SelectedItems,             Collect(                 ColPeopleToPatch,                 {               ...

Power Automate create an Object and append to an Array using Apply to each loop | Get SharePoint groups and their permission levels

 In this demonstration, I am giving an insights of have apply to each loop, I want to create an dynamic array. I have Rest API url getting SharePoint groups and their permission levels in an array which is used to assign to a collection in Power Apps. Using power automate, first I need to call Rest API service Send HTTP Request to SP. GET /_api/Web/RoleAssignments?$expand=Member,RoleDefinitionBindings Parse JSON for our convince. I have created an Array: SPGroupPermissionArray variable I have created an Object SPGroupWithPermissionLevel varaible with value as  { "PermissionLevelID":"", "PermissionLevelName":"" } Apply to each loop to output of Parse JSON body(parse_json) Now I have to set the variables SPGroupWithPermissionLevel Object items('Apply_to_each_2')?['RoleDefinitionBindings']?['results'][0]?['Id'] items('Apply_to_each_2')?['RoleDefinitionBindings']?['results'][0]?['Name'] ...

Power automate Flows for SharePoint

We can assign sharepoint memeber to a SharePoint group Note: Every group name has a prinicple ID which we need it to play around. Step 1: using connector "Send HTTP request to Sharepoint" Step 2: Use end points as below for Url: Here 6 is the group ID we can get from sharepoint settings click on group and in the URL we can find the group ID. _api/web/sitegroups(6)/users Step 3: Headers Headers: accept application/json;odata=verbose content-type application/json;odata=verbose Step 4: Body  Body: {"__metadata":{"type":"SP.User"},"LoginName":"XYZclaims"} Note: Keep remember quotes "" are required when dynamically passing claims value {"__metadata":{"type":"SP.User"},"LoginName":"@{items('Apply_to_each')?['Claims']}"} Note: Here xyzclaims means your dynamic "people picker field having claims" In SharePoint list for an Item, Assign Unique permiss...

Chapter 1 - Graph API understanding

Visit graph.microsoft.com  https://developer.microsoft.com/en-us/graphter Enter to graph explorer enter our office 365 credentials It provides REST Apis that provides that can talk to each other of  different office 365 products. It can be outlook, calendar, onedrive, SharePoint, etc... Left side we have different services first get profile information. Get my profile, then GET v1.0 default, URL we can observe. then click on RUN, we can observe the Response preview. It shows displayName, givenName etc...in {} braces. there is something called modify permissions. User.Read, User.ReadWrite etc...that we can set. But as a developer we need to take care of SharePoint site permissions by developer parallelly.  ReadWrite, ReadBasicAll - allows to " consent " the permissions. We have similarly, Out look calendar events, onedrive etc... In Chapter 2 - GraphAPI, We create a webpart and call the user profile properties through graph API and show it in nice way. https://tejasadventu...