Using Custom Actions to Update another field #67
-
Hi, How can I manipulate or Modify the a certain field using Custom Actions:
I can't get the reference of the field I want to manipulate //Snippet |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Manipulate form data. You can use custom actions or code actions: /**
* @param {ActionEventArgs} e - the action arguments.
* @param {} args - the action parameters arguments.
*/
async function Action (e, args) {
const val = e.value
e.data.rsDropdown1 = !!val ? 'a' : 'b'
} The form: {
"version": "1",
"actions": {
"changeDropdown": {
"body": " const val = e.value\n e.data.rsDropdown1 = !!val ? 'a' : 'b'",
"params": {}
}
},
"form": {
"key": "Screen",
"type": "Screen",
"props": {},
"children": [
{
"key": "rsCheckbox1",
"type": "RsCheckbox",
"props": {},
"events": {
"onChange": [
{
"name": "changeDropdown",
"type": "code"
}
]
}
},
{
"key": "rsDropdown1",
"type": "RsDropdown",
"props": {}
}
]
},
"localization": {},
"languages": [
{
"code": "en",
"dialect": "US",
"name": "English",
"description": "American English",
"bidi": "ltr"
}
],
"defaultLanguage": "en-US"
} |
Beta Was this translation helpful? Give feedback.
Hi @junixquiaoit
Manipulate form data. You can use custom actions or code actions:
The form: