I have a database query that returns data like this:
"LABEL","CONTAINER_ID","STATUS"
"14.JW24","1006063116","F"
"14.JW25","1006063116","F"
"1.JW2M","9999997","R"
"8.282","9999999","R"
"4.135","9999999","F"
"6.43","9999999","F"
"11.12","9999999","R"
"14.JW12","1006063073","R"
"14.JW13","1006063073","R"
"14.JW10","1006063068","F"
I'm using Dataweave to create a list of the distinct container_id values that have a status of "F". Something like:
["1006063116", "9999999", "1006063068"]
Here is my dataweave script:
%dw 1.0
%output application/java
---
payload filter $.STATUS == "F" groupBy $.CONTAINER_ID pluck $$
This works fine except that I get a list of com.mulesoft.weave.model.structure.QualifiedName objects instead of a list of strings.
How can I modify the dataweave script so I get strings, or alternatively, how can I get the string value from the QualifiedName object? I've tried calling toString() and getName() on the object. The former doesn't give the value I need and the latter doesn't work.