-
Notifications
You must be signed in to change notification settings - Fork 170
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
JSON Square Brackets Added to Array's First and Last Objects #260
Comments
Hi @tehfonz, this was great info, thanks. From my research, although SN says it wants json for the payload, that's not applicable to List based fields. Values for those fields are just comma separated and not arrays which add [ ] when converting to json. Converting to a string with I'll give some thought to the best way to handle this and update you when I've come up with a solution. |
@tehfonz would you mind testing the fix? |
Hey! So sorry for the long delay. I have finally been able to test this, however I'm not sure how as I have no updated module or code? It looks like this fix was blocked? Am I reading that wrong? |
My turn to apologize for the long delay. The updated code is in the PR, https://github.com/Snow-Shell/servicenow-powershell/pull/261/files. |
Environment
Steps to reproduce
Expected behavior
Field in ServiceNow should just be populated with
Server1
&Server2
Actual behavior
Field in ServiceNow is populated with
[Server1
&Server2]
Screenshots
Not sending an array and instead casting a single object as a string removes the brackets
Sending a variable cast as a string with "array" objects separated by a comma adds them to the field separated by a line (i.e. unique entries) and no square brackets:
So if the variable is an array:
Works, sending the data without brackets. Unsure what you can do with this info, I can build my script around it, not sure if this matters to anyone else or if I'm just using the function incorrectly.
Cheers
_Fonz
The text was updated successfully, but these errors were encountered: