Showing posts with label SharePoint Document Library. Show all posts
Showing posts with label SharePoint Document Library. Show all posts

April 28, 2022

SharePoint - Document Property Promotion and Demotion Feature - How this works, issue & resolution

Introduction

Recently we implemented a SharePoint based solution for a Postal and Parcel company based out of Melbourne, Victoria, Australia. We worked with multiple SharePoint document libraries for our project. Once we came across a scenario when we upload a document, then the document's metadata gets auto-populated or it becomes blank for some specific scenarios and document types.


In this blog, we will learn about this issue, why it gets blank for some specific scenarios and document types, and also we will understand the relationship between the issue and the Document Property Promotion and Demotion feature associated with the document library. 

Issue

  • When we upload a new document to the SharePoint document library the metadata properties get selected automatically which was not the expected behavior for the document library.
  • When we upload an existing document, it was overwriting some of the properties and was clearing out the values for some of the properties.
  • We wanted an experience to be like when the user uploads a new document it should have blank values for its properties. And, if the user uploads an existing document the document should maintain its properties. 

Solution

    • To resolve this issue, we tested the upload process with different document types like docx, xlsx, .pptx, .pdf, .jpg, .png etc. 
    • We faced this issue with office documents only like Word Documents, Excel Files, etc. 
    • We came to know that SharePoint provides a feature called Document Properties Promotion and Demotion. 
    • This feature is responsible for auto-setting the document’s properties when we upload the document to the document library. 
    • If we create a new document, it won't have any metadata associated with it. 
    • And, if we download an existing MS Office document from a SharePoint Document Library that document will be downloaded with its metadata properties and when we upload the same document to a document library then its metadata will get overwritten for that item after the document gets uploaded successfully. 
    • To resolve this issue, we can erase the metadata associated with the document before uploading it to the document library as shown below. 

    Step 1: 

    Open the document in MS office and go to the File Info menu and click on the Check for issues option. 

    Step 2: 

    Expand the Check for issues and click on the Inspect Document as shown below. 

    Step 3: 

    It will open the Document Inspector. Now, click on the Inspect button as shown below.

    Step 4: 

    Now, click on the Remove all button as shown below. 
    • By performing the above steps, we can remove the metadata values associated with the document. 
    • The Document Property Promotion and Demotion feature causes this behavior of copying and storing the document's metadata while downloading it. And overwriting its metadata while uploading that same document again in the library. 
    • We can disable the Document Property Promotion and Demotion feature for SharePoint on-premises but we can't disable this feature for SharePoint Online.  
    • But, This feature is very useful apart from this issue. For example, when we copy the file from one document library to another document library and if the destination library contains similar columns, it will copy-paste the document metadata automatically. We won't need to update it manually. 

    Conclusion

    This is how we can resolve the Document Property Promotion and Demotion feature’s issue. Hope this helps you. 

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

    March 3, 2022

    Copy a File with New Name in SharePoint Document Library using Power Automate

    Introduction

    In this blog we will learn how can we copy a file with a new name from one Document Library to another Document Library using Power Automate. Follow the below steps to copy a file with new name:

    Steps

    Step 1: Add an action for Initialize Variable. Now create a variable for the new file name and give it a value. This value will be the new file name that you want after copying the file. This file name will be with extension.

    Step 2: Now, add an action for Get file content.

    • In Site Address field, select the site from which site's document library you want to copy the file.
    • In File Identifier field, select the file which you want to copy using the folder icon of this field.

    Step 3: Now, add an action for Create file

    • In Site Address field, select the site where you want to copy the file.
    • In Folder Path field, select the path of the folder where you want to copy the file by clicking on the folder icon. (In above screenshot, we have used dynamic path)

    • In File Name field, select the variable which we have created in first step.
    • In File Content field, add the below expression:
      • body('Get_file_content')

    Step 4: Now when this flow will be triggered, it will copy file with the new name.

    Conclusion

    This is now we can copy a file with a new name using Power Automate. Hope this helps!

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

    July 15, 2021

    How to download the InfoPath form template (XSN file) when the Library/List contains more than 5000 items?

    Introduction

    We implemented the migration of the InfoPath forms from SharePoint On-Premises to the SharePoint Online environment for a Postal and Parcel company based out of Melbourne, Victoria, Australia.  The first step towards migration is to download the XSN file and then we can update it as per SharePoint Online version. We can download the XSN file from SharePoint Designer but when we have more than 5000 items the SharePoint Designer does not let us navigate to the directory where the InfoPath form is stored.


    So in this blog, we will learn about how to download the InfoPath form template (XSN file) when the library/List has more than 5000 items. 

    Scenario 

    • When we have to modify an InfoPath Form of a SharePoint list/library we download the InfoPath Form Template (XSN file) using SharePoint Designer. 
    • We modify that file in InfoPath Designer and then we republish it to the SharePoint List/Library. 

    Issue 

    • In such situation,  when we try to navigate to the InfoPath form directory we face the restriction of SharePoint Designer as shown below. 

    Solution 

      • To resolve this issue, we used a different approach to download the InfoPath form template (XSN file). 

      Steps to download the InfoPath form template (XSN file)

      Step 1:

      First, open the List/Library settings from where we need the InfoPath Form (XSN file) as shown below 


      Step 2:

      • In the "Settings" click on the “Advance Settings” tab as shown below. 


      Step 3:

      • Now, Select “No” in the “Allow management of content types?” option. 
      • When we choose this option, the “Edit Template” option will appear after the Template URL as shown below. 


      By clicking on the “Edit Template”, the InfoPath form template (XSN file) will be downloaded and will be opened in the InfoPath Designer directly. 


      Conclusion

      This is how we can download the InfoPath form template (XSN file). Hope this helps you.


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

      June 17, 2021

      [Resolved]: Different issues and their solutions while publishing InfoPath form to SharePoint Online environment.

            Introduction

            We performed the migration of the InfoPath forms from SharePoint On-Premises to the SharePoint Online environment using InfoPath designer for a Postal and Parcel company based out of Melbourne, Victoria, Australia. Wupdated the InfoPath form as per the online version, but when we start publishing the form, we encountered some issues.

            In this blog, we will learn about these issues and the solutions which we encountered while publishing the InfoPath form. 

            Scenario

              • We had an InfoPath form with multiple data connections. 
              • First, we changed the data connections according to SharePoint online environment then we publish the form to a SharePoint library but when we tried to publish the InfoPath form for the first time, we faced and resolved these issues. 

              Issues and Solutions

              Problem 1: 

              • When we publish the InfoPath form at the end of the Publishing wizard it shows an alert box as “InfoPath cannot save the following form: form name. This document library was either renamed or deleted... 
              • This issue was detected when we tried to publish the form for the first time.
              • The issue is "The library is either renamed or deleted..." even if the library is correct in SharePoint online.
               

              Solution: 

              • To resolve this issue, we need to make changes to the server from where we are trying to publish the InfoPath form template. 
              • We have to add the "Desktop Experience" feature in the server manager. 
              • The issue occurred because the "Desktop Experience" feature is responsible for the connection between the SharePoint server and the window server while publishing an InfoPath form and it was not installed in our system. 

              Steps to add the "Desktop Experience" feature

              Step 1: 

              Open server manager and click on the "Managetab from the top ribbon and choose the "Add Roles and Features" option as shown below. 


              Step 2: 

              • It will open the “Add Roles and Features Wizard”. 
              • Here, in the "Features" section we have to expand the "User Interface and Infrastructure" and select the "Window Experience" feature and after completing the steps of this window we need to restart our server. 


              Now the error will be resolved and we will be able to publish the InfoPath form.

              Problem 2  

              Sometimes we detect this issue. 
              • When we publish the InfoPath form, at the end of the Publishing wizard it shows an alert box as InfoPath cannot save the following form: form name. Access Denied...". 
              • This issue occurs when we try to publish the form for a site that is not a trusted site in our system. 


              Solution: 

              • To resolve this issue, we have to add the targeted site to the "trusted sites". 

              Steps to add a site to the trusted sites  

              Step 1: 

                Open the  Internet Explorer and click on the "Internet Options" as shown below.
                 

                Step 2: 

                • Click on the "Security" tab, then open "sites" as shown below. 
                • It will open a window where we can add our site and make it a trusted site.

                Now the error will be resolved and we will be able to publish the InfoPath form.

                Conclusion: 

                This is how we can resolve these issues and publish the InfoPath forms successfully. Hope this will help you.

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