Description
Notice
Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:
- Are you using
Invoke-PnPSiteTemplate
orGet-PnPSiteTemplate
? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/pnp/pnpframework/issues. - Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
- If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/pnp/powershell/tree/master/src/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/pnp/pnpframework/issues
Reporting an Issue or Missing Feature
I'm initiating a UP Bulk Import job through New-PnPUPABulkImportJob and unsure of how to "clear" a date value. When our HR system indicates that a user's bday should be hidden (after it was previously stored) we need to clear out the existing value in SPS-Birthday. We've tried setting the SPS-Birthday value in the JSON to:
- null - the import job appears to ignore the property and leaves the value as it was before
- "" (empty string) - the import job sets the value to January 1.
Is there a way to clear existing values from date fields when using Bulk Import jobs?
This seems to only be an issue with the bulk imports. If I connect and address each user individually, this works:
Set-PnPUserProfileProperty -Account $userInfo.userId -PropertyName "SPS-Birthday" -Value $null
Expected behavior
I would expect that if I include "SPS-Birthday":null in the json import data file, that the specified birthday would be set to null (not ignored).
Actual behavior
When a date value is set to null, it is ignored, not overwritten as null. When a date value is set to the empty string, it gets saved as January 1.
Steps to reproduce behavior
Representative Sample json file data (uploaded to SP Doc lib):
{
"value": [
{
"UserId": "auser@company.com",
"SPS-Birthday": null,
"Subdepartment": "subdept",
"EmployeeType": "Employee",
"Country": "ES",
"CellPhone": "+1234567890",
"SPS-HireDate": "12-31-00"
}
]
}
and I queue the job as:
$userProfilePropertyMapping = @{
"Country"="Country";
"SPS-Birthday"="SPS-Birthday";
"SPS-HireDate"="SPS-HireDate";
"CellPhone"="CellPhone";
"EmployeeType"="EmployeeType";
"Subdepartment"="Subdepartment";
}
New-PnPUPABulkImportJob -Url $SPFilePath -IdProperty "UserId" -UserProfilePropertyMapping $userProfilePropertyMapping
What is the version of the Cmdlet module you are running?
(you can retrieve this by executing Get-Module -Name "PnP.PowerShell" -ListAvailable
)
2.2.0
Which operating system/environment are you running PnP PowerShell on?
- Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify