Appending Consumer Data to Upstream Request via Post Plugin Function


I am attempting to append a header to upstream requests via the Kong Functions (Post-Plugins) by applying the plugin to a service so it will apply to all requests.

I am attempting to lookup the Custom_Id field of the authorized consumer and append that as the value of the header, shown below. I am not sure how to test this so the syntax may be off, but I am just getting 400 responses from Kong with no data. Is my syntax off, or something else?

Also, what would the syntax be for obtaining a custom field off the consumer, if it were a developer object? For example, if I had a custom field of ‘Organization Id’ on the developer signup form, how can I look-up and append that as the header value here? Below is a screenshot showing how I can use the Admin API to obtain the developer record where you can see the custom field in the meta field, I just am unsure how to build this out in Kong.