The following query returns the #value of the Picklist:
select locale#value from mytable
returns: "nl"
But when I use some MySQL functions, this always returns the ID:
select concat('locale = ', locale#code) from mytable
returns: "locale = 1234567"
Why is that?
Hi ,
I have tried #value and #code in selectQuery API for picklist fields such as 'country' picklist and observed that values are returned correctly.
rbf_selectQuery("select country_picklist#code from test_QueryApi", 1000, function my_callback(d){
console.log(d);
});
returns : UK , US , etc
rbf_selectQuery("select country_picklist#value from test_QueryApi", 1000, function my_callback(d){
console.log(d);
});
returns : "united Kingdom" , "United states" , etc
Thanks,
Sharavan
Try to use a Mysql function in your selectquery, then you should face the same situation
#value, #code are expressions interpreted in Rollbase layer (evaluated in Rollbase code). If you use MySQL functions they will be evaluated at MySQL layer where only code is stored in the database column. As of now we do not support functions like concat to be interpreted at Rollbase layer.
I would suggest that you do concat in JavaScript while processing the results from the SelectQuery.