Skip to content

Using Custom Actions to Update another field #67

Closed Answered by ashalugin
junixquiaoit asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @junixquiaoit

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":…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by junixquiaoit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants