Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow choicesUrl to include parts of the current JSON object #147

Open
aeberhart opened this issue Apr 6, 2022 · 0 comments
Open

Allow choicesUrl to include parts of the current JSON object #147

aeberhart opened this issue Apr 6, 2022 · 0 comments

Comments

@aeberhart
Copy link
Contributor

aeberhart commented Apr 6, 2022

In forms, the choices of one input field often depend on another field. For instance, choosing a country (e.g. US) would restrict the state choices to AL, AR, AK, ....

We could achieve this in two ways / syntaxes:

  1. JavaScript template literal (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals):
    choicesUrl = /get/states/$ {country}. This is more readable but raises the question what kind of expressions are allowed. For instance, Can we use a more complex expression like $ {address[1].state}?

  2. Allowing choicesUrl to be computed using a JSONata expression, similar to this "compute" example:
    https://dashjoin.github.io/#/example/compute. Less readable, since the expression requires JSONata string concat and escaped quotes. We have the full flexibility though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant