2

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"  />

1 Answer 1

5

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.

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.