Hi! I'm Ramesh Beerla, working as a Team Lead and passionate about developing automated solutions to customers. In this blog I will post some important articles which will be useful for fellow developers
Wednesday, November 20, 2019
List Item Count in SharePoint Online
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
function GetListItemCount($siteUrl)
{
#*** you can also move below line outside the function to get rid of login again if you need to call the function multiple time. ***
$Cred= Get-Credential
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL)
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
$ctx.Credentials = $credentials
$web = $ctx.Web
$lists = $web.Lists
$ctx.Load($lists)
$ctx.ExecuteQuery()
Write-Host -ForegroundColor Yellow "The site URL is" $siteUrl
#output the list item count
$tableListNames = foreach ($list in $lists)
{
$objList = @{
"List Name" = $list.Title
"No. of Items" = $list.ItemCount
}
New-Object psobject -Property $objList
}
Write-Host -ForegroundColor Green "List item count completed successfully"
return $tableListNames;
}
GetListItemCount "https://SharepointSite"| Out-GridView
#GetListItemCount "https://SharepointSite"| ExportCsv -Path "C:\itemcount.csv"
Thursday, November 14, 2019
Embedding PowerApps As A Web Part On SharePoint Page
It is now possible to embed PowerApps into SharePoint Online pages as web parts using iframes. The PowerApps and the SharePoint Site (where the app is to be embedded) need to be part of the same Office 365 Tenancy.
Although an app with mobile layout can be embedded on the SharePoint page, for better usability and look-feel, it is recommended to create an app with tab layout.
I have used the ‘Asset Checkout’ tab layout default template from PowerApps to create the app.
- To embed the app in a SharePoint Page, we will need to generate the embeddable URI for the app. For this, get the App id. Go to the app details page on web.powerapps.com and the app id will be listed as a GUID on the app's details page.
- The iframe code is as follows -
<iframe width="98%" height="98%" src="https://web.powerapps.com/webplayer/iframeapp?hideNavBar=true&source=iframe&screenColor=rgba(104,101,171,1)&appId=/providers/Microsoft.PowerApps/apps/[yourAppID]" />
- The width and height propertiesare set to 98%, to ensure that there is no grey background area around your app.
- hideNavBar - It is a Boolean which controls whether the PowerApps header is visible or not.
- screenColor- controls the loading screen color while the app loads
- Create a page on your SharePoint Site and embed the above code using the "Edit" mode.
- You will be able to access PowerApps from your SharePoint Page.
This is not the final version of the capability and it is expected that the Microsoft team will bring in a better way to do this in future.
Subscribe to:
Posts (Atom)