Вопрос

Is there any way how to set metadata of specific document by XML file?

For example

We have OCR system which can store information about document in XML file (invoice number, supplier, date, etc.) and I want to take that XML -> upload it to the Sharepoint Online (or do it automatically by flow or something) -> pair that metadata with document (lookup by invoice number?).

You can even send me third-party add-ins but the solution with Sharepoint only (PowerShell, Flow, etc...) would be best.

Это было полезно?

Решение

Solution 1 (Third-party - paid)

If third party solution is feasible, use Simego data synchronization studio https://www.simego.com/solutions/sharepoint-integration. You can setup xml file location to read xml files and set the target as SharePoint library. Finally schedule it in Windows Task Scheduler.

Solution 2 (BCS - XML connector)

BCS supports only SQL Server, WCF, .Net and OData source. So you need to create a XML connector to read xml data and store it in a SharePoint list. The brief outline is below and detail is here.

  1. Create a Class Library project in Visual Studio.
  2. Create a class and implement ISystemUtility interface from in Microsoft.BusinessData assembly.
  3. Build the project and deploy the dll to GAC (c:\windows\assembly). Restart IIS
  4. Create a BCS model and upload it to central admin.

Sample C# code for XML connector

public class XMLConnector : ISystemUtility 
{
    public void ExecuteStatic(IMethodInstance mi,
        ILobSystemInstance si,
        object[] args,
        IExecutionContext context)
    {

        switch (mi.MethodInstanceType)
        {
            //Single product view
            case MethodInstanceType.SpecificFinder:
                int id = (int)args[0];
                args[1] = GetProduct(id);
            break;
            //Product Listing
            case MethodInstanceType.Finder:
                args[args.Length - 1] = GetProducts();
            break;    
        }
    }
}

Sample BCS model

<Properties>
    <Property Type="System.String" Name="SystemUtilityTypeName">ClassLibraryProject.XMLConnector, ClassLibraryProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3c36ccc14bfdf0d2
    </Property>
</Properties>

<LobSystemInstances>
    <LobSystemInstance Name="ItemsData">
        <Properties>
            <Property Name="xmlfilepath" Type="System.String">c:\testfolder\products.xml</Property>
        </Properties>
    </LobSystemInstance>
</LobSystemInstances>

Solution 3 (custom code)

Custom code like powershell or a console application.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top