CSOM
CSOM allows users to access SharePoint site which are hosted outside with out using webservices like REST APIs.
We have 2 options in SP.
1. .Net C# CSOM
2. JSOM
CSOM happens behind.
Converts API call in to XML and send to the server.
Server receives the request and make appropriate calls
Server gives back the data to SharePoint in the format of JSON
Step 1: Create the context
Step 2: Use load/loadquery to specify what data we wish to get
Step 3: ExecuteQuery/ ExecuteQueryAsync Sending the request to the server
Here API request sending to the server in the format of XML
Step 4: Make changes to the data
Step 5: Save the data using ExecuteQuery/ExecuteQueryAsyn
Here data received from the server in the format of JSON
If we create sharepoint solution in VS 2012, default using Microsoft.SharePoint.Client
Otherwise, for general C# code we need to add the dll and specify in .cs file
Microsoft.SharePoint.Client
Refer: https://www.c-sharpcorner.com/article/sharepoint-client-object-modal-csom/
By using the clientcontext object, get the context from the site URL
Clientcontext clientcontext = new Clientcontext("siteurl");//// Get SharePoint web
Web web = clientcontext.web;
ListCollection listcol = web.Lists.getbytitle('listname');//get list
CamlQuery query = new Camlquery();//specify what date we wish to get by using camlquery
query.ViewXml = "<View/>";
Listitemcollections items = list.GetItems(query); //
clientcontext.Load(listcol);//retrieve the list collection properties
clientcontext.Load(items);
clientcontext.ExecuteQuery();//execute the query to the server
We are getting the data in the format of JSON
foreach(List list in items ){
console.WriteLine("List ID"+list.ID+" List Title"+list.Title);
}
SPFx
Question: What is extension?/ Application customizer?
Extensions or Application customizers are client side components the runs based on SP page context.
Injecting a script to the sharepoint page.
using serve.json under pageURL property, we provide the URL.
Question: What is Graph API?
Able to connect with office 365 or Azure using API.
provides API access token access OAUTH v2, Support OData protocol, gives data back in the format of JSON
Question: How to add SPFx webpart to teams
in the cmd prmpt while creating webpart, it asks
"do you want to allow the tenant admin to deploy the solutions..."-Yes
manifest.json file we find the property named supportedHosts, by default it has sharepointwebpart, now we need to include one more for teams as "TeamsTab"
"supportedHosts": ["SharePointWebPart", "TeamsTab"],
Question: communication site by default custom script is not allowed, manifest.json - enable custom script by adding property requiresCustomScript: false
What is the purpose of Communication site
Communication site is choosen when requirements is for some large audience to broadcast news, articles, portal pages, reports, status updates etc with visually appealing by choosing blank or from templates.
We can share the site to eveyone or specific users.
Question: Deploy tenant wide: package-solution.json
skipFeatureDeployment: true
Question: How to link the library with webpart?
After creating a library with funtions or methods we need to consume through webparts.
Then we will create a webpart, We need to make sure the prompt
"do you want to allow the tenant admin to deploy the solution.." - Yes
and in cmd prompt when we are in webpart path, we have to link with the library.
using npm link libraryname
<p>Calling the function resides in our library</p> <p>${myInstance.getCurrentDateTime()}</p>
Question: How do you package your solution?
In order to deploy in SharePoint completely, along with Javascript, CSS and other assets to be packaged with "--ship" option in the command.
For the purpose of completely deploy webpart in SharePoint, run the below commands.
gulp bundle --ship
gulp package-solution --ship
Question: How to make REST calls using SPFX?
Previously we use Javascript and JQuery for REST API calls.
Now in SPFX, we have predefined class called SPHttpClient.
HttpClient is parent class and SPHttpClient is sub class and used to perform REST API calls.
We use GET method to fetch the data.
URL string
SPHttpClientConfigation - used to set the default headers and version numbers.
ISPHttpClientOptions - which optional, used for optional parameters, for setting the web URL.
hence we import the required packages as below
import { SPHttpClient, SPHttpClientResponse, SPHttpClientConfiguration } from '@microsoft/sp-http';
Question: What is react life cycle
Nintex
Power Apps
DateDiff(Today(), DateValue("28/08/1991"))
In power apps lookup column in patch how do you do?
In patch method
lookupcolumn: {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:3,
Value:"Complete"}
For people picker field
Patch(
'Requests for Access',
Defaults('Requests for Access'),
{
Title: "",
Requester: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Lower(
LookUp(
Office365Users.SearchUser(),
DisplayName = cbusername.Selected.DisplayName
),
Email: LookUp(
Office365Users.SearchUser(),
DisplayName = cbusername.Selected.DisplayName
).Mail,
Picture: "",
JobTitle: "",
Department: "",
DisplayName: cbusername.Selected.DisplayName
}
}
)
Refer: https://www.c-sharpcorner.com/article/powerapps-patch-fuction-with-complex-columns/
Power automate: split(outputs('Compose'),'sites/')[0]
Offline App capability:
Online- app fetches data from data source.
Offline- App fetches data from cache file using LoadData function
Online - App saves the data to data source and refresh the local cache.
Using timer, we will check whether app is online or not.
If it is offline, the posted data will be save to the app cache by using SaveData method.
When ever it is online, this cache data will be saved to the data source.
Add rows dyanamically to a gallery
Insert gallery - blank
add text input fields
1. Name, 2. Address
screen onvisible property:
collect(userdetailsLines, {lines:1});
gallery - source: userdetailsLines
add line button:
Set(TotalLines, TotalLines+1);
Collect(userdetailsLines,{lines:TotalLines);
Remove icon:
Remove(userdetailsLines,ThisItem);
Reset button:
ClearCollect(userdetailsLines,{lines:1);
Submit Button:
ForAll(Gallery1.Allitems,
Collect(mysubmitgallery,{name:name.txt,address:address.txt);
);
Power Portals
Power Apps makers can now create a powerful new type of experience: external-facing websites that allow users outside their organizations to sign in with a wide variety of identities, create and view data in Microsoft Dataverse, or even browse content anonymously. The full capabilities of Dynamics 365 Portals, previously offered only as an add-on to customer engagement apps (Dynamics 365 Sales, Dynamics 365 Customer Service, Dynamics 365 Field Service, Dynamics 365 Marketing, and Dynamics 365 Project Service Automation), are now available standalone in Power Apps.
These capabilities feature a revamped end-to-end experience for makers to quickly create a website and customize it with pages, layout, and content. Makers can reuse page designs through templates, add forms and views to display key data from Dataverse, and publish to users.
Converting from trails to production global administrator and system administrator can do.
When we are converging portal from trail to prod, we have to make sure environment also should be in prod converted.
We can coverg existing license to capacity based license.
Dataverse starter portals are default studio template, page with title, page with child links
Templates in portals
1. Customer service portals
2. Partner portal
3. Employee service portal
4. Community portal
5. Portal from blank
To share the portal page to internal users,
First create a security role and assign user to the security role.
Make sure user has access to the environment.
Developer should have system administrator as recommended.
Liquid
Liquid is open source object langague allows dataverse table to loop in render data, or render table guid based we can show our login information or any other HTML snipped.
Question: Configure by code snippets
Leftside->Under Code snipped, we can inject eigther HTML or liquid object code.
Leftside->Under Web templates - Add the new code snippet created to the new web template
{% include 'snippet' snippet_name:'AccountData' %}
Leftside->On top we can see page template: Create new page template
Select newly created web template,
Now create new page, select blank page, under components right hand side, choose template name as page template we create.
Now our code snippet what ever we wrote will be render in the page.
Question: Dataverse how to anonymous access?
https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/configure-portal-authentication
In power portal admin central, there is called "web roles" for setting permissions to the unauthenticated users.
Under "web roles", We can find "web page and web site" access control rules.
Here, Portal allows portal users with the choice of signin with external account based ASP.NET identity.
Though not recommended, portals also allows a local contact membership provider-based account for users to sign in.
Through email address, they can signin.
These are options for users to allow sigin options are Microsoft account, FB, LinkedIn, Twitter, Google and Local authentication with email.
Question: DataVerse:- Environment relation
Once environment is created, users from Azure AD are automatically added.
using security roles, providing permissions to the data and users
Question: diff types of security roles:
System administator
System customizer
Environment maker
basic user
delegate
and custom security roles.
System adminstrator: CRUD, customizations, Security roles
System customizer: CRUD(Self), Customizations
Environment maker: Customizations
Basic User: CRUD(Self)
Delegate: Act on behalf of another user or impersonate.
Model Driven App
Model driven app, component focused approch to app development.
apps can distributed as a solution.
approch:
Modeling the business data,
define the business process,
compose the app
In order to create model driven app to a requirement, there will a busines process, which makes user journey easy and more focused to their work.
business process can be created setting->advanced customizations-> open solution explorer, select process->new
composing model driven app
we have site map(navigation puropose)
Dashboards, Business Process flows
Entity views(12)
eg:
Accounts: Forms(6), Views, Charts(2)
Activity: Forms, views, charts
While creating navigation site map,
select site map designer->new subarea
To understand the model driven app components, The components and component properties that designers use to make up an app become the metadata.
To understand how each of these components relates to app design, they are sepeated in to data, UI, logic and visualization categories.
Data:
table, relationship(1:N, N:1, N:N), Columns, Choice columns
UI: App, sitemap(navigation), Forms, views
Logic: BPF,
Workflows(Automating, with out user interaction),
Actions(process that let you manually invoke actions, including custom actions, directly from workflow)
Business rules(validation purpose)
Flow(power automate for notifications, collect data etc..)
Visualizations:
Charts, Dashboards,Power BI
There is advance model driven app making .
the solution explorer is a comphrehansive tool used for model-driven-app. It shows all components using navigation pane on the left side of the tool.
Forms:
Types of Model driven Forms:
Main forms:
Forms provide main user interface for interacting with table data.
Quick create:
For updating tables, these forms provide a basic form optimized for creating new rows.
Quick view:
For updated tables, thse forms appear with in the main form to display additional data for a row that is referenced by a lookup column in the form.
Card: Used in views for Power Apps apps. Card forms are designed to present information in a compact format that is suitable for mobi.le devices.
In Main forms, In order to open the dialog as a popup or right hand side, there is javascript code to embed accordingly.
These dialogs are worked based on client API javascript code.
Apply custom business logic with business rules and flow in model driven apps:
Business rules:
It is basically a drag and drop interface.
creating rules that most commonly used rules.
example:
If you select this item ... The scope is set to..
Set column value
Clear column value
Set column requirement levels
show/hide columns
Enable/Disable columns
validate data and show error message,
create business recommendations based on business intelligence
Flow:
Automated flow: trigger by a event, one or more task etc..
Buttonflows:
Scheduled flow:
Business process flows:
Enter the data consitently and follow the same steps every time they work in an app.
Workflows and actions:
related to D365 classic dataverse which has workflows and actions.
Question: Sharing a Model-driven app using Power Apps:
Power apps use role-based security for sharing.
role based security is worked based on custom roles, which has to be created initially.
while creating custom roles, a table shows with check box to select and provide appropriately.
After all, My Apps->click on elipse-> click on share->select user-> manage roles->select custom role we created.
General Questions:
1. how to do group by in views for model driven apps?
Using editable grids users can do rich inline editing directly from views and sub grids they are using a webapp, tablet, phone
2. Can we share a canvas app with external busines partner and contractor:
Yes we can. Using azure ad b2b external collaboration for the tenant, guest user can be invited to use the app.
Vairables:
Global variable and context variables.
Global variable - Set
Local variable - UpdateContext, Navigate
Collections - Collect, ClearCollect
Delegable functions:
Filter, Search, LookUp
StartsWith, EndsWith
Sort, SortByColumns
Sum,Avg,Min
Non Delegable(C-based):
CountRows, Concat, Choices, Collect, ClearCollect, CountIf, RemoveIf, UpdateIf, GroupBy, Ungroup
Partial delegable:
AddColumns, ShowColumns, RenameColumns, DropColumns
Question: Working with containers?
Containers are building blocks of the repsonsive design.
There are two containers:
Horizontal container, Vertical container
x=0, y=0, width=Parent.Width, height=parent.height.
We can choose container inside a container.
example: I have added a vertical container in a screen.
Inside vertical container->add horizontal container.
We can adjust align property - vertical to strech to make full fill the vertical space.
Container has flexible width property - turn on
Question: Make App response layout In Containers.
Scale to fit
Lock aspect ratio
Lock orientation
When we choose screen as blank template, other templates are split screen, slidebar, header-mainsections-footer.
Question: In order to show more information in the app screen.
Settings: Scale to fit turn off.
Then settings->
apps width property matches with designwidth,
Max(App.width, app.designwidth)
apps height property matches with designheight.
max(app.height, app.designheight).
Components:
Design screen size: Max(App.Width, App.MinScreenWidth)
Components in Powerapps are reusable building blocks for canvasapps. So that app makers are allowed to create custom components across the apps.
These components can be exported and imported to other apps to make use.
Header and Footer component, we can make use it in the entire app.
Standar look and feel.
A component consists of input properties that are capable of receiving values from the app.
Component also include the output properties that are capable of providing output values to the app.
Question: How to create Component in power app
New component -> and created MenuComponents
New custom property ->
Items
Input Type
Data Type: Table
Table({Item:"Home"}, {Item:"Admin"}, {Item:"About"}, {Item:"Help"});
We have to create an output property, before that, I have added on vertical gallery in MenuComponents
Gallery1 - with only text label
Items:
MenuComponent.Items
It will show list of Menu's
Now create an output property:
New custom property->
Selected
Output Type
Data Type: Text
click on created Selected property, click on advanced - >
we observe Selected(Output)
Gallery1.Selected.Item
Which means we are passing an output.
In our MenuComponent, since we already added on gallery control
Hence Gallery1.Selected.Item which ever is selected been an output from our output property named as selected.
Question: What is Scope in components?
In MenuComponent which we create, right hand side there is an option called "Access App Scope", we have to make it enable after created a component.
It helps us to use our component with following accessibles
Global variables, Collections, Controls and components on the screen such as text input control,
Tabular data sources such as Dataverse tables.
If we are trying to import/export this component to other app, then it won't work.
Because, this Access App Scope enable feature only works for this app alone.
Question: How do you import and export a component.
We have components library to do this.
After creating component, elipse we can see import or export components. click on export components option.
In My Apps -> Components -> Import compoents
https://blog.cloudthat.com/top-25-microsoft-power-apps-consultant-interview-questions-and-answers/
Custom connector life cycle:
Build you API,
Describe your API and define the connector,
use your connector,
Share your connector(optional),
Certify your connector(optional)
1. Build your API: REST API that allows by logic apps, power automate,
for public api's we can manage with azure api apps, azure web apps, azure functions
2. Secure your API:
using oAuth 2.0.
use Azure AD authentication for your API for azure portals which is more secure.
3. Describe your API and define the connector
describe or use your api via logicapps or power automate.
API supports
OpenAPI or Postman collection
Share and Certify,
Share means to use in organization level.
Ceritfy will be done review by microsoft.