@jpbell - that is curious … one follow up question, so I can better determine how to best report this back to the product team as a bug:
In your original configuration from the first post (without the additional output mapping), if you leave the “Result variable” blank and only provide the “Result expression”, do you get a different result?
Also some environment information:
are you using SaaS or a Self-Managed instance?
if SaaS, what version is your cluster running? If Self-Managed, what version of Zeebe and the Connector Runtime/bundle are you using?
@jpbell - I just realized the answer, and feel a bit silly I didn’t realize it earlier! This isn’t a bug, but the documentation can use some work here.
The “Result expression” is invoked inside the Runtime, which only has access to the data from the request/response itself, not to any process variables. (You can see that here in the code.) This is why it works when you provide a hard-coded string value for the filter comparison, but not when you a process variable. However, the output mapping is handled by the process engine itself, after the Connector has returned.
For your example, you could trim the response using a “Result expression” like ={ items: response.body } then in the output mapping you can output a variable named domain_label with an expression value of =items[ item.name = string(bu) ].label[1]. You can omit the “Response variable” value entirely, unless you want to the entire response from the API available as a global process variable.
I think the correct way to think of the “Result expression” field is “I don’t need the whole response back, just these bits of data.”
I’ll raise a ticket with our documentation team and find a way to make this more clear in the documentation.