ahaydon / Qlik-Cli-Windows

Qlik-Cli for Windows
https://adamhaydon.uk/Qlik-Cli-Windows/
GNU General Public License v2.0
110 stars 51 forks source link

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

Open LenHoover opened 8 months ago

LenHoover commented 8 months ago

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

Any help will be greatly appreciated.

ahaydon commented 8 months ago

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"]