pnp / pnp/pnpframework

Is there a way to keep itemid using DataRows to import data for lookup fields / lists

Open
#888 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
259
Forks
161
Avg merge
10h 33m
Merged PRs (30d)
1

Description

I have use Get-PnPSiteTemplate to get the schema of a site.

Then I've used Add-PnPDataRowsToSiteTemplate for two lists, let's called them Property and PropertyType.

When exported, I have for propertytype:
<pnp:DataRows UpdateBehavior="Overwrite">
pnp:DataRow
<pnp:DataValue FieldName="Title">House</pnp:DataValue>
<pnp:DataValue FieldName="Order">100</pnp:DataValue>
<pnp:DataValue FieldName="MetaInfo" />
<pnp:DataValue FieldName="FileLeafRef">20_.000</pnp:DataValue>
</pnp:DataRow>
pnp:DataRow
<pnp:DataValue FieldName="Title">Apartment</pnp:DataValue>
<pnp:DataValue FieldName="Order">200</pnp:DataValue>
<pnp:DataValue FieldName="MetaInfo" />
<pnp:DataValue FieldName="FileLeafRef">22_.000</pnp:DataValue>
</pnp:DataRow>
</pnp:DataRows>

For property to simplify:
pnp:DataRow
<pnp:DataValue FieldName="Title">House1</pnp:DataValue>
<pnp:DataValue FieldName="Order">100</pnp:DataValue>
<pnp:DataValue FieldName="MetaInfo" />
<pnp:DataValue FieldName="Address1">10 Highstreet</pnp:DataValue>
<pnp:DataValue FieldName="PropertyType">1</pnp:DataValue>
<pnp:DataValue FieldName="FileLeafRef">20_.000</pnp:DataValue>
</pnp:DataRow>

When I use Apply-PnPProvisioningTemplate, all the ids of Propertytype have changed, so every Property has the wrong Propertytype.

Could you help me exporting this so that when imported the ids are the same?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the flow using Get-PnPSiteTemplate, Add-PnPDataRowsToSiteTemplate, and Apply-PnPProvisioningTemplate with the PropertyType and Property lists described. Trace how the PropertyType lookup value is exported and resolved during import; done means imported Property rows retain the intended PropertyType association when source list IDs change.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.