Skip to content
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

Multibple dropdown field value not displaying when requesting though API #813

Open
Growlert opened this issue Jul 18, 2024 · 2 comments
Open

Comments

@Growlert
Copy link

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?

@Mirkk
Copy link

Mirkk commented Jul 26, 2024

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.

@Growlert
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants