Fixed issue with Guid values not being supported for "TaxonomyFieldType" fields in batch scenarios (Set-PnPListItem, Add-PnPListItem)#5174
Conversation
…pe" fields in batch scenarios (Set-PnPListItem, Add-PnPListItem) Unified handling of input values for taxonomy items when using batch.
|
@erwinvanhunen Could you have a look at this one please? |
|
Sorry for the long time before we process this PR @reusto. I've just tried to reproduce the issue on our latest dev branch, so without applying your PR, and it seems to be working fine for me. Might be doing something different than what you did when you ran into this issue. Can you elaborate what could be different in my test case? $b = New-PnPBatch
|
|
@KoenZomers No problem. Providing the term guid as a string is working fine, but not if the term id is given as type of GUID e.g. when directly using the output from Therefor the test should look like this: $term = Get-PnPTerm -Identity "17f0e25e-0a3c-4309-af3b-f95df3139bf1"
$termGuid = [Guid]::new("17f0e25e-0a3c-4309-af3b-f95df3139bf1")
$b = New-PnPBatch
add-pnplistitem -List "PR5174" -Values @{"Title"="2";"Test"=$term.Id} -Batch $b;
add-pnplistitem -List "PR5174" -Values @{"Title"="3";"Test"=$termGuid} -Batch $b;
Invoke-PnPBatch -Batch $b |

Type
What is in this Pull Request ?
Fixed the following issues for fields of type TaxonomyFieldType for Add/Set-PnPListItem command when used in a batch scenario:
This already worked previously for fields of type TaxonomyFieldTypeMulti therefor I extracted the code for both variants to a single additional helper function so that both share the same code now.