October 11, 2019

FileShare migration with updated metadata to SharePoint

We have a requirement to migrate the large number of documents from File Share System to SharePoint with metadata. Normally, we can easily migrate the large number of documents from File System to SharePoint, but the challenge is to update the large amount of metadata in SharePoint List/Library in quick time.

Resolution:

To change the metadata manually one by one is a very time-consuming process. And it is very complicated to update the large amount of metadata using OOTB “Quick Edit” feature of SharePoint.

To overcome this challenge, we have used ShareGate, third-party tool. 

We can migrate the files from File Share to SharePoint with updated metadata in very quick time using below steps.
  • Browse the ShareGate application, then select the “Import file shares” option as shown in the below screenshot. 

  • Connect the Source folder - File share path and Destination - SharePoint Library where documents need to be migrated.
  • Select All or Particular Documents for which metadata needs to be updated.
  • Click on “Export metadata”.

  • Update the Configuration as required and click on “Export”.

  • Click on “Open file” to update metadata in the excel file.
  • For multiple managed metadata column, add the comma-separated values. 
  • For Person or Group column, add the values like “Firstname Lastname” as shown below.

  • Once the metadata are updated, click on “Import & Edit” to import the documents with updated metadata.

  • You can also import the updated metadata from "Copy" section as shown below.

  • Files with updated metadata will be imported in SharePoint document library.

If you have any questions you can reach out our SharePoint Consulting team here.

October 1, 2019

How to get Organization Asset Libraries in SharePoint Online using REST API

Organization Assets Library is a new feature introduced in Office 365 which is a tenant level object. Currently, Organization Assets Library can be created only through PowerShell commands.

I was developing custom SPFx web part to display a list of Organization Assets Libraries. As it was a custom SPFx web part, I was looking for approach like REST API calls to fetch the Organization Assets Libraries instead of CSOM. After a deep analysis, I came to know that we can use REST API call to get the Organization Assets Library with their properties.

Solution:
Use below SharePoint REST API to get the Organization Assets Libraries for a tenant:

https://<Tenant.sharepoint.com>/_api/Microsoft.Online.SharePoint.TenantManagement.Office365Tenant/GetOrgAssets

This API will return the collection of Organization Assets Objects. It will return below properties for organization asset objects as shown in below screenshot.
REST API call result schema

Here are few points about Organization Assets libraries and REST API those need to be noted:
  • This API is retrieving tenant-level objects (Microsoft.Online.SharePoint.TenantManagement.Office365Tenant). So, it will return results only for users who are assigned with "SharePoint Administrator" role in the Office 365 tenant. 
  • All the Organization Assets objects must be created in a single site collection only.
  • Once the object/library is created, it will take 24 hours to get the Organization Asset objects using the API . Here is the more details how this API works:
    • There is an Azure function, which gets triggered by a timer (once a day).
    • The function gets SharePoint metadata and extracts all valuable information into JSON object.
    • The function stores JSON in Azure blob.
    • SharePoint REST API Metadata uses JSON, saved by Azure function to show you the metadata info.
If you have any questions you can reach out our SharePoint Consulting team here.

September 20, 2019

Performance issues with SPFx web parts [Solution: Fix it with implementing renderCompleted & isRenderAsync methods]

We mostly encounter performance related issues, like - Page takes very long time to load all features while working with highly customized SharePoint site. To identify performance issue of Custom SPFx web parts, Microsoft suggests to implement RenderCompleted method.

I searched over the internet but did not find any good documentation on how to implement it. After spending time on analysis & research, finally I was able to implement it successfully.

Here, I am providing you with detailed steps to implement renderCompleted & isRenderAsync methods to identify performance of custom webparts.

Solution - To implement such methods, open custom web part source code - solution in Visual studio.
  • Open Interface file and add below property to it.
    asynccompfunc:() => void;
  • Now, go to the ".ts" file of your custom webpart and add below highlighted code in "Render" Method.
          public render(): void
            {
               const element: React.ReactElement<ISubmitNewsProps> = React.createElement(                                 SubmitNews,
                 {
                    // other properties...,
                    asynccompfunc:this.renderCompleted
                  });

                ReactDom.render(element, this.domElement);   
            }
  • Also, add below code after "Render" Method.
           protected renderCompleted(): void { 
                super.renderCompleted();   
           }

           protected get isRenderAsync(): boolean { 
               return true;   
           }


  • Now open ".tsx" file and add below code in "componentDidMount" method.
         //Init Function of component mount 
           public async componentDidMount() {
           
            //your code
           
           this.props.asynccompfunc();
         }


After applying all changes in your web part, deploy package and open the page where you have added the webpart.

Click "Ctr + F12". to see the performance of your web part.


Note: This method requires "BaseClientSideWebPart" class to be extended. Application Customizer does not extend this class. So we cannot implement this method in Application Customizer.

If you have any questions you can reach out our SharePoint Consulting team here.