Pregunta

I am trying to create a lookup list field (not a site column, just a plain list column) using the OfficeDev Patterns and Practices provisioning engine. I cannot seem to get the List attribute in the correct format. In the past the value could be specified as List="Lists/MyListName" but that doesn't seem to work with PnP. I know that SP really prefers the GUID instead of the list name but since the target list is provisioned a few lines above the lookup column that isn't practical.

Interestingly, the field XML I tried to use at first actually came from the PnP Engine's GetProvisioningTemplate method, so I feel pretty confident that the issue isn't an XML issue but rather either a PnP or CSOM issue.

For the interested, the XML I am trying to use is this:

<Field Type="Lookup" DisplayName="Contract" Required="FALSE" EnforceUniqueValues="FALSE" List="Lists/Contracts" ShowField="ID" UnlimitedLengthInDocumentLibrary="FALSE" Indexed="TRUE" RelationshipDeleteBehavior="Cascade" ID="{AValidGuid}" StaticName="Contract" Name="Contract"  />
¿Fue útil?

Solución

I ended up fixing this issue. It was due to the fact that the lookup field was in a sub web and there was a bug in the PnP Core that I fixed and issued a pull request for.

For anyone who stumbles on this post, the actual syntax for the List attribute should be:

List="{listid:ListName}"

The tokenized syntax is unique to the PnP provisioning engine, so it is only applicable in that scenario.

Licenciado bajo: CC-BY-SA con atribución
scroll top