Skip Navigation

[Resolved] I’m trying to insert a toolset custom field into gravity forms dynamic insertion

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

Problem:
How to use a Types custom field as the dynamic source for a field in Gravity Form?

Solution:
Note how the field value can be passed in the gravityform shortcode, as described in the linked documentation.

The types shortcode to output the custom field value can be used in the field_values shortcode attribute, like so:

[gravityform id="2" title="true" description="true" field_values="hoa-partner-email=[types field='hoa-partner-email' output='raw'][/types]"]

Relevant Documentation:
https://docs.gravityforms.com/using-dynamic-population/

This support ticket is created 5 years, 5 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by joshN 5 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#1319811

I am trying to: I'm trying to insert a toolset custom field into gravity forms dynamic insertion and I don't know what shortcode to generate. It is custom field 'HOA Partner Email' in field group 'HOA Partner Information'

Link to a page where the issue can be seen: hidden link the filed is a hidden field I want to have the partner email auto filled upon submission so I an route the notifcations there.

I expected to see: The email I entered in the custom field 'HOA Partner Email' for Blind and Shutter Spot which was jnorris@thehomeownersalliance.com

Instead, I got: {!{types field='hoa-partner-email' output='raw' separator=', '}!}{!{/types}!} which I thought would work. Is there a shortcode output of that?

#1320031

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Josh

Let me give you a couple of quick pointers here, and if they don't help I'll investigate further.

Regarding the shortcode, that format—with {!{ shortcode }!}—is used by Toolset with some page builders to overcome certain compatibility issues regarding embedding Toolset shortcodes in page builder modules.

It is a proprietary format that would not otherwise be recognised outside of this context.

You can try using the standard shortcode format with square brackets, i.e. [shortcode].

But, it has been some months since I used it, but I thought with Gravity Forms dynamic field sources you could simply provide the custom field meta_key.

Note that Types fields add a 'wpcf-' prefix, so that a Types field with slug of 'appointment' would be stored with a meta_key of 'wpcf-appointment'.

That may be all you need.

If I've mis-remembered how GF dynamic sources work then let me know and I'll create a test site to check on what is required.

#1320173

I'm sure I'm missing something simple. Here is what I am putting in:

[gravityform id="2" title="true" description="true" field_values='hoa-partner-email={wpcf-hoa-partner-email}']

it is outputting {wpcf-hoa-partner-email} rather than the email I have in the custom field which is jnorris@thehomeowneralliance.com.

Any ideas on what needs to be changed?

#1320337

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

You output a types field using a types shortcode, so according to the GF documentation (hidden link) you can try using a types shortcode to provide the value for the field_values attribute of the gravityform shortcode.

Here's the kind of thing:

[gravityform id="2" title="true" description="true" field_values="hoa-partner-email=[types field='hoa-partner-email' output='raw'][/types]"]

Now, WordPress does not natively support using shortcodes for attributes of other shortcodes, but Toolset does. I'm not 100% sure if it will work in a gravityform shortcode, and the easiest way to know is for you to try.

If it doesn't, let me know and I can propose another solution.

#1320347

My issue is resolved now. Thank you!