Recent searches
No recent searches
Help retrieving custom organization field
Posted Jan 15, 2025
Hi everyone!
I'm building my first ZCLI app and I'm trying to pull the value of a custom organization dropdown field with the following line:
organization.custom_fields.arr
note: ‘arr’ is the field key
This works except it returns the tag, not the value, of the dropdown selection. How do I get it to show the value?
1
1 comment
Greg Katechis
Hi Ben! That is technically the expected behavior, except we don't have that documented currently, which makes “expected” kind of confusing. I'll get something updated there to prevent this confusion down the line.
I think the easiest way to get the value in this situation is to make the initial request a promise and chain it to a `client.get('organizationFields:arr.options')` call, then filter those results by the response that you get in the initial request by the `value` key, and then return the corresponding `label`that is associated with it. I haven't tested this code, but you can try something like this:
0