Qlik-Cli-Windows icon indicating copy to clipboard operation
Qlik-Cli-Windows copied to clipboard

Adding Custom Property Values to a Custom Property return bad 400 error?

Open LenHoover opened this issue 1 year ago • 1 comments

Hi,

I need assistance please? I am running the following command and receive a "bad 400 request" error :-(

Here's the code : $StreamValue = 'Len_Testing123' $allcurrentvalues = @((Get-QlikCustomProperty -id 311a92b5-5939-4a6e-a5ab-66c3bc97f5e8).choicevalues) $allcurrentvalues += $StreamValue Update-QlikCustomProperty -id 311a92b5-5939-4a6e-a5ab-66c3bc97f5e8 -choiceValues $allcurrentvalues

With running the command with -verbose in the Update-QlikCustomProperty function this is the detail : VERBOSE: PUT https://xxxxxxxxx.com:4242/qrs/custompropertydefinition/311a92b5-5939-4a6e-a5ab-66c3bc97f5e8?xrfkey=zpqrauiqssesecuu with -1-byte payload Invoke-RestMethod : The remote server returned an error: (400) Bad Request. At C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\1.23.1\functions\core.ps1:69 char:23

  • ... $result = Invoke-RestMethod @paramInvokeRestMethod @params

Any help will be greatly appreciated.

LenHoover avatar Feb 18 '24 21:02 LenHoover

When running the command with the Verbose flag it will print the request body that is sent to the API, I would check this output to see if there is something wrong with how the request is being constructed. Here is the choiceValues when I ran your code: "choiceValues":["A","B","C","Len_Testing123"]

ahaydon avatar Feb 19 '24 10:02 ahaydon