Pass field value to URL parameter

contacts
forms

#1

Hello!

So basically, we’ve built custom private pages for our client’s customers. The thing is that there are many customers groups/segments and we created one private page per group.

So, in order to join these pages, the users must fill out a form inside HubSpot and one of the form fields is called “Security Token”, a single-line text field.

Depending on the group they belong to, the customers will enter a different “Security Token”, with this “token”, we identify the segment where they belong to.

So, for internal purposes, we need to pass the “Security Token” field value into a string parameter in the URL of the page that they’re redirected.

An example:

  1. The user fills out the form (COS Page and HubSpot form), and its token is “TOKEN101”
  2. Form is submitted and it’s redirected to the desination page.
  3. The destination page URL should be “www.example.com/destination-page?token=token101

Is there any way to achieve this? Maybe using Forms API?

Thanks in advance for your time :slight_smile:


#2

Hey @Borja_InboundLead,

did you end up working out how to do this? I have the same challenge.

Thanks in advance,
Sam


#3

Would love to know if there is a solution to this yet?


#4

According to this API endpoint documentation you must use content-type:application/x-www-form-urlencoded, so you ll lost your redirect link’s get parameters. But you can analyze your token before cURL call and/or use some service link like example.com/token/<your_token> with redirect to example.com/destination-page?token=token101


#5

Hi all,

Regarding the original question; if you were to use a custom HTML form and the forms API, you could redirect the visitor to any URL with whatever query parameters you’d like. You could also customize the form embed code to dynamically change the redirectUrl to include query parameters, as previously discussed on the forums:


#6

If the form is on a COS page, then i think it is easier than you think (you won't even have to do anything api related)

  1. Go to edit the form module

  2. Even if you are going to an internal page, click redirect to external URL

  3. redirect to your desired page and attach whatever contact property you desire via query parameters.
    http://redirect-address.com/the-page?token={{contact.your_internal_property_name}}

After you click save, you can see your link when you hover over test link


Include form fields as redirect URL parameters on an embedded form
Passing Email ( and other properties) from Form fill as query parameter in redirect URL
Forward a to a friend button