Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using -IncludeCustomVariable: Id must either be a SysId 32 character alphanumeric or Number with prefix and id. #262

Closed
CATgwalker opened this issue Apr 10, 2024 · 0 comments · Fixed by #263

Comments

@CATgwalker
Copy link
Contributor

Environment

Operating System: Windows 11
ServiceNow module version: 4.0.3
PowerShell version: 5.1

Steps to reproduce

Include custom variables on a request or catalog item that are blank, not filled out or otherwise do not have a "value" returned from sc_item_option_mtom.

This is a continuation of #234.

Expected behavior

The custom variable is not further enumerated in the sc_item_option_mtom table and not added to $record.CustomVariable result object.
The original sc_item_option.Value id number should be retained for performing additional metadata lookup later on if needed

Actual behavior

Throws error listed below - this can occur multiple times for each custom variable on a catalog item that does not have a "value"

Get-ServiceNowRecord : Cannot validate argument on parameter 'ID'. Id must either be a SysId 32 character alphanumeric or Number with prefix and id.
At C:\Users\...\Documents\WindowsPowerShell\Modules\ServiceNow\4.0.3\Public\Get-ServiceNowRecord.ps1:368 char:117
+ ... on.item_option_new.reference' -ID $var.'sc_item_option.value' -Proper ...
+                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-ServiceNowRecord], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Get-ServiceNowRecord

Screenshots

image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant