Issue importing a Managed MetaData Field

Jan 18 at 8:15 AM
Hi all,

I have used this tool a lot for importing and it works great. Now I come across an issue I cannot solve.
First of all: I am using Office 365.

I have a single-valued Managed Meta Data column named "Tijdvak" ((translated to English it means: Timeperiod) that contains a hierarchical structure of years, quarters and months:

Image

I am trying to import this using an importmapping:
    <ImportMapping xsi:type="ImportMapping_ManagedMetaDataCSOM">
      <DestinationField>Tijdvak</DestinationField>
      <SourceColumn>Tijdvak</SourceColumn>
    </ImportMapping>
But well ... the files are imported succesfully, but the MMD field is not imported. No further error message is generated.

Link to Excel-importfile

Link to Configuration file (anonymized)

Can you see whats going wrong?

Thanks in advance.
Theo
Coordinator
Jan 18 at 9:45 AM
Guessing that maybe 2017-q1 is not available for tagging, maybe try 2017-q1-Jan or change that tagging

If not that then enable logging
Jan 18 at 10:17 AM
Thanks for replying MadAboutImport.

I just did some more testing ... Everything works fine when I have a plain list without content types. In that case 2017 en 2017-Q1 are set properly.

But when I switch to using content types the fields are not set anymore. I have tried also another MMD field with same results.

Perhaps this gives a clue?
Jan 18 at 10:18 AM
O, and logging is not possible on Office 365.
Coordinator
Jan 18 at 10:52 AM
Make sure you are using the latest difs version

Turn on logging in difs (see manual)

You can then see the error message reported by difs

You can also try making fields non mandatory

Sometimes the problem is that the same cannot be performed because you are not setting a mandatory field and so even a good field setting fails
Jan 18 at 1:36 PM
I must be doing wrong. I followed your instructions above (I am/was using version 2.7). I do not have mandatory fields.

I set the autoflush option to true but no logs are created. I ran DIFS as administrator, started it from the command line as administrator, etc, etc. The log is stored in D:\Temp\SPImportHelper.log, which is a location that I can write to. But no logs appear.
Coordinator
Jan 18 at 8:25 PM
Normally this means that there are no errors being logged (I know it's confusing and will be changed).

My DIFS.exe.config looks like this and logs just fine (if there is an error applying meta data) but produces no log if there are no errors.
<?xml version="1.0"?>
<configuration>
    <configSections>
    </configSections>
<startup>
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
  <system.diagnostics>
    <!-- By setting autoflush false the listener will not be written to; this can get BIG.  Set to true for troubleshooting -->
    <trace autoflush="true"></trace>
    <sources>
      <source name="SPImportHelper">
        <listeners>
          <remove name="Default"/>
          <!-- The log file specified below will contain full details the of import.  The user running the import must have write permission and autoflush must be set to true.  If left in the default program files directory you must Run as Administrator -->
          <add name="eventlog"
              type="System.Diagnostics.TextWriterTraceListener"
              initializeData="c:\temp\SPImportHelper.log">
            <!--
            <filter type="System.Diagnostics.EventTypeFilter" initializeData="Information"/>
            -->
          </add>
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
</configuration>
Jan 23 at 3:26 PM
I have been able to get the logging working (by testing it with some real bad metadatavalues) and it started logging. Unfortunately the scenario I describe below does not result in any logging.


After tons of tries and investigation I finally found a pattern in the results.


For test I am using an existing Excel-file I have used for ages. Its date is old (2014): Northwind June Expense Categories.xlsx

I dit the following test in importing this and another XLSX file, but all with some metadata-field for the Tijdvak-field.
  1. Import Northwind June Expense Categories.xlsx and keep its destination name the same.

    This will result in no metadata added in SharePoint Online.
  2. Import Northwind June Expense Categories.xlsx and change its destination name to a1 (without extension).

    This resulted in the metadata being added in SharePoint Online.
    This gave me the idea to start with an new Excel-document instead of the Northwind one.
  3. Import Test.xlsx (brand new almost empty) and keep its destination name.

    This file is imported correctly with metadata.
    So it is something in the Northwind file.
    There was a content type id in it (but no property Tijdvak). So lets get rid of the id first by removing this property.
  4. Import Northwind June Expense Categories.xlsx but now without the contenttype id in it.

    Still no metadata.
    Ok, then the big cleansing: remove all personal info and xml data in the file.
  5. Imported the clean Northwind June Expense Categories.xlsx.

    Tada! The file is now imported and the metadata is set correctly.
So, ....
a. There is something in my Excel file that causes problems, but I have no idea what.
b. When imported SharePoint Online interprets this Excel file somehow and refuses to add metadata.
c. when imported with no Excel extension for the destination filename SharePoint will accept the metadata

Well at least I have the cause localized. I am going to import now a lot of data and we will see if the metadata gets added. I hope these files are ok. I'll keep you informed, if you want.
Coordinator
Jan 23 at 4:22 PM
Edited Jan 23 at 4:23 PM
Sounds like the problem is with property promotion.

Click here

Always GREAT! to hear about your experiences