You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
magonzalezm
changed the title
Is there a way to keep itemid using DataRows to import data
Is there a way to keep itemid using DataRows to import data for lookup fields / lists
Jun 1, 2023
Yes, I know that the ID cannot be set from pnp normal scripts but I expected that the provisioning template would do it, or should do it. Compare this to the Sharepoint Migration Tool, the SMT respects the IDs we are migrating.
I suppose they have conceived the provisioning template as a tool to display structures, but not data, because if it was so, they should have respected the IDs, for these cases.
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?
The text was updated successfully, but these errors were encountered: