[FORM ENGINE] Default JSON

Usage

  • Support default value for question with json path

Technical:

Using libs:

Syntax

type appearance
any default(‘json’,‘type’,‘filename’,‘json_path’)
any default(‘json’,‘type’,‘question’,‘json_path’)

Note

  • type: value => file or question. To specify the input source is filepath or question. Support ${} by default.
  • filename: json filename. Only support get file from instance path(see: https://help.rta.vn/t/formengine-search-api/1370). Support ${} by default.
  • json_path: The json path. Support ${} by default.
  • question: The input question. Support ${} by default.

Big Note:

Example

type name default appearance
text source {“tinh_id”: “tinh1”}
text default_json_question default(‘json’,‘question’,${source},’$0.tinh_id’)
text search-api tagging-choices-noshow search-api(‘POST’,concat(‘https://es.rta.vn/c872_vn_admin3/_search’),’{“size”: 1000,“collapse”:{“field”:“tinh_id.raw”},“query”:{“bool”:{“must”:[/{“query_string”:{“query”:"%input%",“fields”:[“tinh_name”],“allow_leading_wildcard”:“true”,“default_operator”:“AND”}}/]}},"_source":{“excludes”:[]},“sort”:[{“added_date”:{“order”:“desc”}}]}’,‘tinh_id’,‘tinh_name’,’$.hits.hits.*._source’,‘sl1’)
text default_json_question default(‘json’,‘file’,‘sl1’,’$0…tinh_id’)

FORM:

Default_json.xlsx (29.7 KB)