I exported several 2sxc entities of a content type called "Series" that I wish to modify and reimport to the same system. I was able to successfully modify the data in Excel and export to a new XML file for reimport. However, when I try importing the data in the XML file, 2sxc throws the following error:
Had an error talking to the server (status 400).
Message: Bad Request
Detail: trying to resolve guids for this relationship, but can't, because the lookupList is not available
After several attempts to modify and adjust the data being imported, I finally tried reimporting a completely unmodified version of one existing entity (in the site's default language). Even that resulted in the error.
I also tried digging into the 2sxc logs, but I was unable to find anything helpful in solving the issue. See the following screenshot which depicts a portion of the save-data log where the error was generated.
2sxc save-data log screenshot
At this point, it doesn't seems like the issue is in my XML file, so what do I need to do so that 2sxc will import my data? Is there something wrong with my 2sxc instance?
The issue has been identified and resolved. If localized entity relationship fields are imported into 2sxc with any value other than "[]", the import will fail with the above-mentioned error. These fields must inherit from the default language for the import to work.
For example, the following XML will fail to import into 2sxc, returning the error mentioned above:
<SexyContentData>
<Entity Type="Content">
<Guid>505f37bd-7fc6-4c67-ae82-b651b558489c</Guid>
<Language>en-US</Language>
<RelationshipField>a3945cf8-44ae-4bf4-930d-fef85c54f3de</RelationshipField>
</Entity>
<Entity Type="Content">
<Guid>505f37bd-7fc6-4c67-ae82-b651b558489c</Guid>
<Language>de-DE</Language>
<RelationshipField>a3945cf8-44ae-4bf4-930d-fef85c54f3de</RelationshipField>
</Entity>
</SexyContentData>
Again, this is because the field "RelationshipField" of the German entity has its own GUID instead of inheriting from the default (English) entity. Replacing the value of this field with "[]" allows the entities to be imported successfully:
<SexyContentData>
<Entity Type="Content">
<Guid>505f37bd-7fc6-4c67-ae82-b651b558489c</Guid>
<Language>en-US</Language>
<RelationshipField>a3945cf8-44ae-4bf4-930d-fef85c54f3de</RelationshipField>
</Entity>
<Entity Type="Content">
<Guid>505f37bd-7fc6-4c67-ae82-b651b558489c</Guid>
<Language>de-DE</Language>
<RelationshipField>[]</RelationshipField>
</Entity>
</SexyContentData>