pnpframework icon indicating copy to clipboard operation
pnpframework copied to clipboard

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

Open magonzalezm opened this issue 2 years ago • 0 comments

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?

magonzalezm avatar Jun 03 '23 10:06 magonzalezm