1
0
-1

 When attempting to retrieve sub form field value in process form data update tool the value returned to the table is the hash variable statement itself (e.g. #form.ppp_req_tbl_approval.status#) and not actual field value.  Why?  I have two tables and need to retrieve the value from one table column and store that value in the other table column.  This is a main table and secondary table where the main record has many sub records stored in the secondary table (e.g. 1-to-many).

    CommentAdd your comment...

    2 answers

    1.  
      3
      2
      1

      If ppp_req_tbl_approval is your subform, then it cannot be resolved this way. #form.tablename.field# reads the data from the parent form. 

      If I'm not mistaken,  to read data from another form to populate the parent form, you need to use something like this:

      #form.subform.field[{mainform.recordId}]#  OR

      #binder.SUBFORM_DEF_ID.FIELD_ID[PRIMARY_KEY]#

      Hash Variable#FormDataHashVariable

      Hope this helps. (smile)

      1. Steve Powell

        Hi Voon Lok, Thanks much for your quick answer but I am not certain how to obtain the 'recordid' or 'primary key' for the current main record and secondary record as this is during a workflow process and they are not known ahead of time.

      2. Voon Lok

        Yea, that could be challenging. Maybe you could use a Database Update Tool before or after the Form Update tool?

      3. Steve Powell

        Thanks. Got it solved using Database Update Tool from the Map Tools to Plugins with this query below. Now the main flow record shows the correct status for the sub flow record. :-) UPDATE app_fd_ppp_req_tbl LEFT JOIN app_fd_ppp_req_tbl_approval ON app_fd_ppp_req_tbl.id = app_fd_ppp_req_tbl_approval.c_parent_id and app_fd_ppp_req_tbl_approval.c_review_approval_type = 'field-review' SET c_field_review_status = app_fd_ppp_req_tbl_approval.c_status

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Hi, Voon Lok is right. You can use the follow for main form primary key #form.main_form_table.id# and use this for subform #form.subform_table.field[{form.main_form_table.id}]#.

       

      1. Steve Powell

        Thanks, I will try that also. Database Update Tool works for sure.

      CommentAdd your comment...