When I use the ‘.values()’ formatter server-side (PHP), I thought it would take a parameter to return the values of a given object property (like it does client-side). The data picker doesn’t have a parameter option.
What does ‘values’ do server-side then?
What I want to do is use ids from the result of a query to be an ‘in’ parameter for another query. How would I do this?
Looking at the formatters code (which I’m embarrassed to say I should have looked at first!), it looks like the .unique() option would fit too without having to use two formatters.
function formatter_unique($val, $prop = NULL) {
if (!is_array($val)) return array($val);
return array_unique($prop != NULL ? array_column($val, strval($prop)) : $val);
}
As long as you’re happy not having duplicates, which for an ‘IN’ condition makes sense, it seems to do the job. I think having a similar formatter (built in to the Wappler UI rather than custom) that worked the same as unique() but returned all values, would be a good addition.