AI: Legacy form migration
This page is intended for the AI agent when a user asks to convert a form defined in a legacy form-builder JSON format to NGX View Builder JSON.
Core rule
- Do not copy the source JSON 1:1.
- First recognize the semantics of the source form.
- Then map them to the closest supported NGX View Builder structure.
Element map
| Source JSON | NGX View Builder |
|---|---|
text | text or number / phoneInput depending on inputType |
comment | textarea |
radiogroup | radio |
dropdown | select |
dropdown_list | autocomplete |
tagbox | multiSelect |
checkbox | checkbox or singleCheckbox |
boolean | singleCheckbox |
date / date_picker | datepicker |
file_uploader / file_list | fileUpload |
html | customHtml |
message_box | messageCard |
panel | panel |
paneldynamic | dynamicPanel |
matrixdynamic / matrixdropdown | dynamicTable |
dialog | dialog |
Property map
visibleIfmaps directly tovisibleIf— same field name, same polarity, no inversion needed.enableIfis typically mapped todisableIf, but the logic must be inverted.requiredIfmaps torequireIf.resetValueIfmaps toresetIf.setValueExpressiontypically maps toexpression.defaultValuestays asdefaultValueif it is a static value.defaultValueExpressioncan becomedefaultValueif it is a literal, orexpressionif it is a computed value.choicesmaps tooptions.validatorsmaps tovalidators.
Expression translation rules
In the final NGX View Builder JSON, use NGX View Builder / JEXL-style syntax.
Operators
and->&&or->||<>->!==in comparisons ->==iif(cond, a, b)->cond ? a : b
Empty values
x notempty->notEmpty(x)x empty->isEmpty(x)
Collections
anyof->containsAny(left, values)allof->containsAll(left, values)contains->contains(left, value){field.length}->len({field})
Dynamic contexts
{panelIndex}->panel.index{rowIndex}->row.index{parentIndex}->parentIndex{panel.field}->panel.field{row.field}->row.field
Important safeguards
- Do not use source-library property names in the final NGX View Builder JSON if NGX View Builder does not have that property.
- Do not use
and,or,notempty,empty,<>, oriif(...)in final NGX View Builder expression strings. - Do not use self-reference expressions — a field must not reference itself in a fallback branch.
- If
expression,visibleIf,disableIf,requireIf,readonlyIf, orresetIfis added,logicExecutionMode: "onChange"is typically required.
When a 1:1 mapping is not possible
- If a source-library feature has no direct NGX View Builder equivalent, produce the closest safe result.
- In that case, briefly explain in a
warningssection what was simplified or lost.
