Interface with auto populating and editing the text field.

Certified Associate Developer

Hello, 

I have a requirement where the text field should get auto-populated based on the previous action. Once the text field is auto populated I have 2 possibilities. 

1. the user can click on submit without making any changes to the text field. In this case, since there is no user interaction, the value is not storing to the saveinto local variable. 

2. the user can change the text field value as per their choice. In this case, the value is saving to the local variable, but it's not reflecting in the text field, since in value parameter there is another local variable.

a!textField(
label: "File Name",
labelPosition: "ABOVE",
value: local!prepopulatedName, 
saveInto: local!docName,
refreshAfter: "UNFOCUS",

),

Here, local!docName is the variable created for storing the value for this text field. 

local!prepopulatedName is the field from where it's getting auto populated. 

Can someone please guide me here?

  Discussion posts and replies are publicly visible

Parents
  • Try using following code:

    a!localVariables(
      local!documentId,
      a!columnsLayout(
        columns: {
          a!columnLayout(
            contents: {
              a!fileUploadField(
                target: cons!APP_FOLDER_TEMPORARY_FOLDER,
                maxSelections: 1,
                value: local!documentId,
                saveInto: {
                  local!documentId,
                  a!save(
                    ri!documentName,
                    index(
                      index(
                        index(
                          a!fileUploadField(value: local!documentId),
                          "contents",
                          null
                        ),
                        "value",
                        null
                      ),
                      "fileName",
                      null
                    )
                  )
                }
              )
            }
          ),
          a!columnLayout(
            contents: {
              a!textField(
                label: "File Name",
                labelPosition: "ABOVE",
                value: ri!documentName,
                saveInto: ri!documentName
              )
            }
          )
        }
      )
    )

    Save the document name in rule input instead of local so you do not need to make any changes on 'SUBMIT' button.
    Output of above code:

  • 0
    Certified Associate Developer
    in reply to Harsh Kumar Agarwal


    Thanks for your reply. I used similar to your code. In the fileUploadFieldd saveinto, saved the uploaded document name to the local variable and it's working fine. 

Reply Children
No Data