fields icon indicating copy to clipboard operation
fields copied to clipboard

Multibple dropdown field value not displaying when requesting though API

Open Growlert opened this issue 1 year ago • 2 comments

Hello. When I request computers list from GLPI, something like this (in Powershell): $Params = @{ uri = "$GlpiInstance/apirest.php/PluginFieldsComputercmdb?expand_dropdowns=true&range=0-2000" headers = @{ "Accept" = "application/json"; "App-Token" = $GlpiAppToken; "Session-Token" = $($GlpiAuth.session_token) } } $CMDBServers = Invoke-RestMethod @params -UseBasicParsing -SkipCertificateCheck

option expand_dropdowns=true should display names instead of ids and that is perfectly works with, say, simple dropdown. But with multiple dropdown I get emtpy value: glpi_api_empty_value

Without this option API returns list of ID, but I prefer names. How can I fix it?

Growlert avatar Jul 18 '24 12:07 Growlert

Hi @Growlert, What's your GLPI version? These fields were completely empty till now,I opened a request, and Teclib did a fix with 10.0.16 so that it shows the list of IDs also with expand_dropdowns = true, that's much better than before, prevents errors and saves a REST call. I'm happy with this for now and with an additional request for each ID I easily get the names. For GLPI 11 a new REST api is planned, let's wait a bit and see.

Mirkk avatar Jul 26 '24 10:07 Mirkk

Hi, Mirkk. Thanks for the reply. I have 10.0.12 installed. Now I will consider to upgrade, hope it will not break something as I have multiple extensions installed also.

Growlert avatar Jul 30 '24 09:07 Growlert

Hello,

This issue hasn't seen any activity for a while. To keep the tracker clean, we're closing it for now.

Please consider testing again with the latest version of the plugin. If the problem persists, feel free to reopen the issue or open a new one with updated details.

Thanks for your understanding!

stonebuzz avatar May 20 '25 08:05 stonebuzz