1. Choose Bean Shell Form Data Store as the Form's Store Data Store.

  2. Key in the following code.

    import org.joget.apps.app.service.AppUtil;
    import org.joget.apps.form.model.Element;
    import org.joget.apps.form.model.FormRowSet;
    import org.joget.apps.form.model.FormData;
    import org.joget.apps.form.lib.WorkflowFormBinder;
    import org.joget.commons.util.LogUtil;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.sql.DataSource;
    
    rows.get(0).setProperty("field2", rows.get(0).getProperty("field1"));
    
    new WorkflowFormBinder().store(element, rows, formData);

    In the code above, it will copy the value from form element with id "field1" into "field2".

  3. Save the form.


Sample App

APP_kb_dx8_copyValue.jwa

  • No labels