Skip Navigation

[Resolved] How to pass custom field value to gravity form using query URK

This thread is resolved. Here is a description of the problem and solution.

Problem:

Using a custom field with a URL / hyperlink - to send the value of another form field from the same CPT to a gravity form using a URL query string.

Is there any documentation that you are following?

Not really. Just standard HTML for the query string

Is there a similar example that we can see?

Here is the string as of now: https://site-url/registration?coursereq=peds3&instructor=jealous&date=December 12-15, 2018

I have a CPT for a course. one of the custom fields is a URL link to the course registration button. Because there are several different courses, there are 3 different field values that need to be sent to the regsitration form which is built using Gravity Forms. They are:

1. Course Requested
2. Dates
3. Instructor
4. Status (Course OPEN / CLOSED)

the CPT has this info, and I have created similar fields in the Gravity Form, but I need help sending the value from the STATUS custom field to the Gravity Form in the query string.

Solution:

In Types plugin side, you can try with Types shortcode [types] to output the custom field value, and setup it as URL parameter of the link, for example:

http://my-url/?my-param=%5Btypes field='my-field'][/types]

It will be able to output custom field "my-field" value as URL parameter "my-param"

More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/

In "gravity form" side, you will need to check their document to setup the URL parameter:

https://docs.gravityforms.com/using-dynamic-population/
section "Query String"

You can also ask help from the supporters of "gravity form":
https://www.gravityforms.com/support/

Relevant Documentation:

https://toolset.com/documentation/customizing-sites-using-php/functions/

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by Luo Yang 6 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#615472
ex3.jpg

Tell us what you are trying to do?

Using a custom field with a URL / hyperlink - to send the value of another form field from the same CPT to a gravity form using a URL query string.

Is there any documentation that you are following?

Not really. Just standard HTML for the query string

Is there a similar example that we can see?

Here is the string as of now: hidden link 12-15, 2018

I have a CPT for a course. one of the custom fields is a URL link to the course registration button. Because there are several different courses, there are 3 different field values that need to be sent to the regsitration form which is built using Gravity Forms. They are:

1. Course Requested
2. Dates
3. Instructor
4. Status (Course OPEN / CLOSED)

the CPT has this info, and I have created similar fields in the Gravity Form, but I need help sending the value from the STATUS custom field to the Gravity Form in the query string.

If you look at the screenshot I uploaded, its the very last field that I need to send over to my registration form.

What is the link to your site?

hidden link

#615481

Dear Neil,

It is a compatibility problem between Types plugin and gravity-form plugin, I suggest you follow gravity-form document to setup your links with URL parameters:
hidden link

if you still need assistance for it, please provide a copy of your website, also point out the problem "URL" field of gravity form,

https://toolset.com/faq/provide-supporters-copy-site/

You can put it into your own google drive disk, and share the link in the "private detail box", I need to duplicate same problem and debug it in my localhost, thanks

#615871

For the question:
What I need help with is grabbing one value directly from the CPT created with Toolset and also include that in the query string.
In Types plugin side, you can try with Types shortcode [types] to output the custom field value, and setup it as URL parameter of the link, for example:

<em><u>hidden link</u></em> field='my-field'][/types]

It will be able to output custom field "my-field" value as URL parameter "my-param"

More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/

In "gravity form" side, you will need to check their document to setup the URL parameter:
hidden link
section "Query String"

You can also ask help from the supporters of "gravity form":
hidden link

Hope it is clear.

#619111

thank you!

#619550

You are welcome