powershell icon indicating copy to clipboard operation
powershell copied to clipboard

[FEATURE] Export-PnPTermGroupToXml and Import-PnPTermGroupFromXml do not respect order of Terms.

Open Ron-Rohlfs opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. We want the Terms to appear in a specific order within their TermSets. We manually created a TermSet with Terms in a specific order (see Source Hour TermSet.png).

Source Hour TermSet

The Export-PnPTermGroupToXml and Import-PnPTermGroupFromXml commands resulted in the Terms being ordered alphanumerically (see Target Hour TermSet.png).

Target Hour TermSet

Export-PnPTermGroupToXml creates an output file that disregards the source Term order an reorders the Terms alphanumerically within the .xml file (see UtilitiesTermGroup.xml.png).

UtilitiesTermGroup xml

If the xml file is manually edited to put all the pnp:Term elements in the desired order, the Import-PnPTermGroupFromXml command still disregards the ordering and results in an alphanumeric order in the target tenant (see Target Hour TermSet.png above).

Describe the solution you'd like We would like the source TermGroup to be faithfully replicated on the target tenant including the order of Terms within each TermSet.

Describe alternatives you've considered We tried manually setting the order in the Export-PnPTermGroupToXml output file as described above.

Additional context Add any other context or screenshots about the feature request here.

Ron-Rohlfs avatar Mar 05 '24 21:03 Ron-Rohlfs

The ordering can be manually updated through the browser using /sites/< shorturl >/_layouts/15/termstoremanager.aspx?RedirectToModernExperience=false. However, it would be nice to see the ordering preserved in the commands.

Ron-Rohlfs avatar Mar 05 '24 21:03 Ron-Rohlfs

I have just tried to reproduce the problem and I was unable to do so. I have created a term group and a term set with similar terms as you have in your screenshots. I have set custom sort on a term set level. When I execute Export-PnPTermGroupToXml, custom sort is getting preserved (please note CustomSortOrder property on terms below). Same thing with Import-PnPTermGroupToXml - terms are getting correctly imported, taking custom sort into account. image

wilecoyotegenius avatar May 04 '24 18:05 wilecoyotegenius