Here’s some copy/pasta for anyone looking for a quick start. This takes an entry ID and retrieves the lead and form from that. In this case I’m using the URL to pass the value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <?php $lead_id = $_GET['entry']; $lead = RGFormsModel::get_lead( $lead_id ); $form = GFFormsModel::get_form_meta( $lead['form_id'] ); $values= array(); foreach( $form['fields'] as $field ) { $values[$field['id']] = array( 'id' => $field['id'], 'label' => $field['label'], 'value' => $lead[ $field['id'] ], ); } ?> <pre><?php print_r($values); ?> |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.