Skip Navigation

[Resolved] populated custon meta-user with gravity check box values

This support ticket is created 4 years, 1 month 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 6 replies, has 2 voices.

Last updated by Christian Cox 4 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1842037

Hello,

I have created several custom meta-users and two are checkboxes with toolset and I create users with gravityform user registration add-on. Everything is going well except that I can't transmit the values of the two checkbox fields.
How can I do this?

#1842077

url page : hidden link
step 2 and 3

#1842243

Hello, Types field slugs contain a wpcf- prefix in the usermeta database table, so you should configure the field slugs in your Gravity Forms contact form to use the wpcf- field slug prefix as well. For example, if the Types User Field slug is user-birthdate in Toolset > Custom Fields > User Fields, then the corresponding Gravity Forms field slug should be wpcf-user-birthdate in order to capture Types field information successfully. Do you have the ability to adjust these user meta field slugs in your form? If you add a wpcf- prefix, is the information captured successfully?

#1842283

Yes all fields other than checkboxes work but the values of the selected checkboxes are not captured in the user file.

For example, I ask for the opening days and the information goes back in the notification but not in the meta-user fields.

#1842373

Okay thank you for the additional information. I've done some research and it seems that a similar problem has been addressed before in another ticket. This ticket has some example PHP code that can be customized to work in your site: https://toolset.com/forums/topic/saving-checkboxes-and-repeating-gravity-form-fields-into-repeating-user-fields/

There are examples available for single checkbox fields as well as repeating checkbox fields. If you need assistance customizing the code to work for your site, please let me know more about the field slugs and I will put together a similar example for you to try. The code can be placed in your child theme's functions.php file, or added to a new custom code snippet in Toolset > Settings > Custom Code tab. If you need help with that let me know.

#1842451
Capture d’écran 2020-11-12 à 18.37.09.jpg
Capture d’écran 2020-11-12 à 18.37.22.jpg

They are 2 checkboxes

#1842525

I see, I was under the impression that you were referring to single checkbox fields, which are stored in a simple data structure that can be mapped to Gravity Forms quite easily. The fields you have shown here are checkbox groups, and unfortunately checkbox groups are stored in a complex data structure that is not easily converted from a Gravity Forms checkbox group into a Toolset checkbox group. It would require custom PHP code, for which unfortunately I do not have a cut-and-paste solution available.

Here's a ticket discussing how you can filter the data from a Gravity Form before it is saved by Toolset:
https://toolset.com/forums/topic/gravity-forms-date-field-compatibility-issue/

I found a similar ticket that discusses how Toolset checkbox group fields are stored in the database: https://toolset.com/forums/topic/programmatically-update-custom-field-groups/
However, mapping those to Gravity Forms checkbox group fields is beyond what I'm able to offer here in a cut-and-paste solution.

Another similar ticket (Spanish language): https://toolset.com/es/forums/topic/actualizar-por-php-listados-de-checkboxes/

If you want to connect with an independent developer to craft a custom code solution based on these examples, we have a contractors portal available here:
https://toolset.com/contractors
For smaller projects, you may be able to find a developer here as well: https://codeable.io/developers/toolset/