Closed pgrill79 closed 1 week ago
we were missing the expression context in the REST call, so user, variable, href etc. were not set
It seems mostly to be fixed
This works now:
$species:=$number($.variable.species); $call("json_replaceKey", {"data": $all($.variable.db, "breed")[fk_species=$species], "search": "id", "new":"value"});
Also this works
$call("json_replaceKey", {"data": $all($.variable.db, "breed")[fk_species=3], "search": "id", "new":"value"});
For some reason it does not work if i use the variable in the pedicate query:
$call("json_replaceKey", {"data": $all($.variable.db, "breed")[fk_species=$number($.variable.species)], "search": "id", "new":"value"});
in that case i get null. i have to assign it in advance to another "local" variable. as seen in the first example
Good catch - this has a different root cause in the jsonata implementation: https://github.com/dashjoin/jsonata-java/issues/45
closing this issue
we track the jsonata update here: #384
To generate the input options for an input field i use this expression:
( $query($.variable.db, "q_client_getSpecies", {"clientId":"92b4f138-c1d9-45c1-ae82-a6775a2657c3"}).species )
$.variable.db is set to our database (wooltest) - and the preview also works well:
But when you save, the input shows:
If you hardcode the database:
( $query("wooltest", "q_client_getSpecies", {"clientId":"92b4f138-c1d9-45c1-ae82-a6775a2657c3"}).species )
it works.
It seems that the context is not passed, because also if i execute this in the preview:
you see two results, but when saving, the choices are empty:
If you "Hardcode" the client Id - it works.