-
Notifications
You must be signed in to change notification settings - Fork 51
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
Adding Custom Property Values to a Custom Property? #178
Comments
The reason your update is failing is that the choiceValues only has one value and so when you use += it is concatenating the two strings. You need to ensure the values are in an array before adding to it. Try the following instead: $allcurrentvalues = @((Get-QlikCustomProperty -id 5048e219-c48b-4f45-861a-20012cd2df34).choicevalues)
$allcurrentvalues += "456"
Update-QlikCustomProperty -id 5048e219-c48b-4f45-861a-20012cd2df34 -choiceValues $allcurrentvalues I am working on refactoring the handling of properties and tags, so this should get easier with the next release as it will be possible to do this in a single command. |
Hi, Thanks, i've tested your recommendation. it still fails for the same error : The remote server returned an error: (400) Bad Request. {"id":"5048e219-c48b-4f45-861a-20012cd2df34","createdDate":"2022/03/04 13:56","modifiedDate":"2022/03/08 22:08","modifiedByUserName":"xxxxx\xxxxxx","name":"LenTest","valueType":"Text","choiceValues":["123","456"],"objectTypes":["Stream"],"description" |
There seems to be an issue with the date format in the JSON request, this could be the case if you are calling Please try adding the |
I'm using the function from your repository as is. The $prop = Get-QlikCustomProperty $id -raw is there within the Update-QlikCustomProperty function. After me testing with the -verbose option, i noticed that it was successful however it was only successful for the 1st time, when i tested it again (change the values to something different - instead of 456 i tried 789) i received the same error (400) bad request. Here is the output when using the -verbose option : VERBOSE: Raw output: True |
Hi,
How do i go about adding custom property values to a custom property?
Sceanario :
Custom Property is called Len_Test which is of Resource Type = Streams. This custom property has an existing custom property value called "123". How do i add another custom property value "456" programmatically ?
I've tried using the Update-QlikCustomProperty function however i get the following error : The remote server returned an error: (400) Bad Request.
$allcurrentvalues += "456"
Update-QlikCustomProperty -id 5048e219-c48b-4f45-861a-20012cd2df34 -choiceValues $allcurrentvalues
Thanks
The text was updated successfully, but these errors were encountered: