how to pass specific fields (first name, last name) in a form to another application

  • theSC
    Asked on March 13, 2017 at 4:40 PM
  • Chriistian Jotform Support
    Replied on March 13, 2017 at 8:58 PM

    Can you please specify what you mean by passing fields in a form to another application? If you mean you want to pass Form data (first name and last name fields) to another Form, this is possible. Please see this guide on How to Automatically Pass Form Data to Another Form. However, if you mean you want to copy fields to another form, you can try this Field Manager Widget. 

    If you mean something else, please provide us more info and do get us back if you need further assistance.

    Regards.

  • theSC
    Replied on March 13, 2017 at 9:46 PM
    I am using an affiliate tracking system. When a user completes a jotform, I need to pass the First Name, Last Name to the affiliate program. I have added their script below, I need to replace the name fields in order to capture the name of person who filled out the form.

    Script:





    ...
  • Chriistian Jotform Support
    Replied on March 13, 2017 at 11:01 PM

    It seems that the screenshot you have uploaded via email doesn't reach the JotForm forum. Please open this thread: https://www.jotform.com/answers/1090350 on a browser and upload the screenshot/images by following this guide: How to add screenshots/images to questions to the support forum?

     

  • theSC
    Replied on March 13, 2017 at 11:46 PM
    I never sent a screenshot
    Sent from my T-Mobile 4G LTE Device
    ...
  • Chriistian Jotform Support
    Replied on March 14, 2017 at 1:14 AM

    May we know what Affiliate Program you have? Perhaps this guide will help you to achieve your requirements: Send Submission Data via Post Method and Thank You Settings.

    Alternatively, you can also try setting up a webhook on your form. Here's a guide on How to Setup a Webhook with JotForm.

    Please also see this Webhook PHP script samples in this link.

    Regards.

  • theSC
    Replied on March 14, 2017 at 1:46 AM
    We are using Omnistar (http://www.osiaffiliate.com/)

    ...
  • Chriistian Jotform Support
    Replied on March 14, 2017 at 4:15 AM

    I'm not quite familiar with the Omnistar (http://www.osiaffiliate.com/) affiliate program. 

    However, I would suggest you please try setting up Webhook on your form. We have a guide here on how to set this up: How to Setup a Webhook with JotFormYou can create a PHP page and insert the URL of that page into Webhook integration.

    You can add the data and you can add this to the Webhook URL to pass the data to the webhook request into the affiliate program. To easily find out/debug a webhook request e.g. form field names & its sample data, you can use RequestBin

    On the PHP page, you will need to setup the code that will capture the data from the webhook request. Then simply pass that on to your affiliate program with the script from your affiliate program.

    Here's an example code from the Omnistar affiliate program:

    // pass field name and its value by getting fields using get_form_fields API

        $post_data_array = array(

            'first_name'=>$first_name_from_jotform,

            'last_name'=>$last_name_from_jotform,

        );

     

       $handle = curl_init();

        curl_setopt($handle, CURLOPT_URL,$url);

        curl_setopt($handle, CURLOPT_POST, true);

        curl_setopt($handle, CURLOPT_POSTFIELDS, $post_data_array);

        curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);

        $response = curl_exec($handle);

        curl_close($handle);

        if ( !$response ) {

          die('Nothing was returned. Do you have a connection to our server?');

        }

        echo 'The entire result printed out:
    ';

        echo $response;