2

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.

1 Answer 1

2

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.

2
  • OK thanks I will try it, but € 1,438.00 / Year is a lot. Small companies can't afford that.
    – David Rak
    Commented Aug 29, 2017 at 12:44
  • @Sentir I have added solution 2 in my answer. Hope that helps.
    – Ahmad Zia
    Commented Aug 29, 2017 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.