Showing posts with label SharePoint Customization. Show all posts
Showing posts with label SharePoint Customization. Show all posts

December 16, 2021

[Issue Resolved]: "You must specify a value for this required field" error while updating a Multi Valued Managed Metadata column value in Power Automate

 

Introduction

Recently, we implemented an OOTB Document Approval process using Power Automate for a Postal and Parcel company based out of Melbourne, Victoria, Australia. The approval process was built using the "Start and wait for an Approval" action of Power Automate and based on the approver's response the Power Automate was updating the status and other metadata fields of the Document in the SharePoint Library.  So, here we encountered an issue while updating a multi-valued managed metadata column to the SharePoint Library and we resolved it by providing a valid expression value which we will explain in further process.


In this blog, we will learn about the "You must specify a value for a required field" issue and its solution that will help us to store its value in the document library.  

Issue

      • In Power Automate, we used an update item SharePoint action for a multi-valued managed metadata column. 
      • When we use the value of the trigger field it was not binding the value accordingly and the Update item action returns the error You must specify a value for this required field” message with 400 status code as shown below. 

      • We tried with the trigger values of the Category managed property but it was giving as invalid as shown below. 



      • We tried with other metadata properties also like the Category value but it was creating an Apply to each loop because it is a multi-value field and this loop updates the item multiple times with different category field values which was not the correct behavior. 

      Solution

        • When we use update item action, we have to provide all the required field values. 
        • If we do not provide a proper value, then update item action would return this type of error. 
        • As this column was a multi-valued managed metadata column, we have to create an array variable and store all the values in the array with a specific format for storing the value in a correct format to the library. 
        • First, we will create an array variable as shown below. 

        • Now we will store all the managed metadata values in the array inside the Append to array variable action. For that we will pass the expression value in format {item('Apply_to_each_3')?['Value']} as shown below. 











        • We will use the array in the Update item action as shown below.


        Hence, a multi-valued managed metadata column Category values will be stored in the library with the proper format.

        Conclusion

        This is how we can resolve the error with managed metadata multi-valued field in Power Automate. Hope this helps, good day! 

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

        December 2, 2021

        [Issue Resolved]: "Specified argument was out of the range of valid values" while executing Add-PnPSiteScript and Add-PnPSiteDesign PowerShell commands

        Introduction

        Recently, we implemented a SharePoint site design using a PowerShell script for a Postal and Parcel company based out of Melbourne, Victoria, Australia. We encountered an issue while applying the site script and site design during the execution of  Add-PnPSiteScript and Add-PnPSiteDesign commands.


        In this blog, we will learn about the issue and its solution that we can implement while creating a new site design template using the PowerShell script. 

        Issue

          • We normally use the Add-PnPSiteScript and Add-PnPSiteDesign commands to add a new Site Script and Site Design on a SharePoint tenant. 
          • When we execute these commands frequently on the same tenant, a new Site Script is being created every time. 
          • And after some time, we encounter these below issues during the execution of the PowerShell script. 

          Image 1


          • It says “Specified argument was out of the range of valid values”. 

          Solution

            This issue is occurring because there is a tenant level limitation in SharePoint that we can create max of 100 Site Scripts and 100 Site Designs templates.

            • To resolve these issues, first of all, we need to remove some of the unused Site Scripts and Site Designs so that we can add our new Site Scripts and Site Designs. 
            • To remove a Site Script and Site Design, we will be using the below commands. 

             Remove-PnPSiteScript -Identity $scriptID -Force  
             Remove-PnPSiteDesign -Identity $designID -Force  
            
            • Here the $scriptID & the $designID is the ID of the existing Site Script and Site Design that is been available at the SharePoint tenant level.
            • The –Force in the Remove command is used to confirm the execution of this command without asking for confirmation to remove for its execution.
            • We cannot view these IDs directly from the SharePoint tenant, so we will be using the below commands to retrieve the details of these IDs.

             Get-PnPSiteScript  
             Get-PnPSiteDesign   
            

            • The Get-PnPSiteScript & the Get-PnPSiteDesign commands will retrieve the available Site Scripts and Site Design details and we will extract these details, identify unused Site Script/Site Design and will be using them for removing the existing unused Site Design and Site Scripts.
            • And then, it should allow creating your new Site Design and Site Script by executing the Add-PnPSiteScript and Add-PnPSiteDesign commands.

            Conclusion

            This is how we can resolve the "Specified argument was out of the range of valid values" error in the PowerShell script. Hope this helps, good day! 

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

            February 25, 2021

            [Issue Resolved]: Part URI is not valid per rules defined in the Open Packaging Conventions specification

            Introduction

            We at Binary Republik recently implemented Intranet Portal on Modern SharePoint for a Real Estate Agency based out of Washington, United States. We also implemented custom webparts with SharePoint Framework (SFPx) as part of the Intranet Portal implementation to meet the business user expectations. While implementing the custom SFPx webparts, we encountered a strange error. Let's see in detail what error we faced in which scenario, what was the root cause of the error and what's the resolution for the same. 


            Error/Issue:

            • After uploading the ".sppkg" solution of SPFx webpart in the "app catalog", it was giving the error “Invalid SharePoint App package. Error: Part URI is not valid per rules defined in the Open Packaging Conventions specification”.


            Scenario:

            • We created SPFx webpart solution, the solution was built successfully. Then we executed the below commands to create package:
              • gulp bundle --ship
              • gulp package-solution –ship
            • The package was also created successfully, so we uploaded the same to the "app catalog" and it was giving an error as shown above.


            Reason:

            • After some research and analysis, we found, this was because of the parent folder of our SPFx webpart solution.
            • Here is the path of our solution: D:\Projects\Project Management
            • The parent folder name of our solution was "Project Management" (please note, there is a space in the name of the parent folder) and while creating the solution we have selected the option to "Use the current folder" in "Where do you want to place the files?" selection.

            • So, when there is space in the name of the parent folder of your solution, it will give the error “Error: Part URI is not valid per rules defined in the Open Packaging Conventions specification”.


            Solution:

            • To solve this error, remove space from the name of the parent folder of your solution. We renamed the parent folder name to be “ProjectManagement”.
            • Then executed below commands:
              • gulp clean
              • gulp build
              • gulp bundle --ship
              • gulp package-solution –ship
            • And deployed the new package in the "app catalog" and the package was deployed successfully.


            Hope this helps!
             
            If you have any questions you can reach out our SharePoint Consulting team here.