Your query returns the name of a document where the key is the string ‘vkey’. I suspect you want the document where the key is the value of the argument vkey. There should not be quotes around vkey in the select statement.
See Example 2 here. Notice there are no quotes around vActivity in the select statement.
Ok thanks. removing the quotes from function and using them on the call, fixed the issue:
create FUNCTION femaleName(vkey) { (
select name from test .anonymization.femaleNames use keys vkey) };
EXECUTE FUNCTION femalename(‘1’);
result:
[
[
{
“name”: “Nathalie”
}
]
]
also transforming the random number into string for calling the function always as string:
EXECUTE FUNCTION femaleName( to_string(FLOOR(RANDOM()*10)));