Skip Navigation

[Resolved] Map SemiColon separated Values in Toolset Checkboxes

This support ticket is created 3 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
- 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 6 replies, has 2 voices.

Last updated by Luo Yang 3 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#2122937
json_data.PNG

I need some help mapping the data being sent from Zoho CRM via Webhook in Semicolon separated Values in Checkboxes Field of Toolset Custom post field.

I have a post type called "client" and it has almost 40+custom fields and 11 of them are checkboxes fields and I am receiving the post data from Zoho CRM using Webhook, So in Zoho CRM, There are 11 MultiSelect fields where we select multiple values but when these values are being sent using webhook then they are captured in semicolon-separated values.

Something Like

wpcf-mobility: 3;4;7

But these semicolon-separated values are not being mapped in the Checkboxes fields. And Maybe because Checkboxes support Comma-separated values. So I need your help to make it work.

I am attaching a JSON file of the received data. Please review the code and help me how I can convert the data or how we can accept the Semicolon separated data in Checkboxes or if Possible then do we need to convert the checkboxes fields into something else.?

#2123161

Hello,

The Toolset Checkboxes field stores value in serialized array format.
In your case, it needs custom codes, for example:
Within Toolset Types plugin, there is a PHP API function wpcf_admin_fields_get_field(), it can get Types custom checkboxes field settings, including each option's title and option value, you can use them to construct the field value, and save it into database, see similar thread here:
https://toolset.com/forums/topic/update-checkboxes-checked-state-via-php/#post-235795

#2123175

Hi Luo,
Thanks for your response. But I am not familiar with custom function writing. I would request you to please share with me a quick piece of function that does the thing which i need. because the example you shared doesn't seem to be usable for my purpose.

Waiting for your kind response.

#2124879

According to our support policy:
https://toolset.com/toolset-support-policy/
We don't provide custom codes support.

And I have provided a example codes for your reference:
https://toolset.com/forums/topic/map-semicolon-separated-values-in-toolset-checkboxes/#post-2123161

You can also check it with our Toolset Contractors:
https://toolset.com/contractors/

#2126041

My issue is resolved now. Thank you!

#2126953

Hi, So I removed the Checkbox fields and simply added Single line Field (Simple text field) but As I mentioned earlier, The data of the webhook is still being saved as Semicolon separated values, But we want to remove these semicolons and save them with Comma separated. So If you have any alternative then please let me know.

#2127383

Same as your another thread:
https://toolset.com/forums/topic/need-help-to-assign-child-posts-to-parent-post-created-using-webhook/

It needs custom codes, for example:
1) After Child post was created, use action hook save_post to trigger a PHP function:
https://developer.wordpress.org/reference/hooks/save_post/

2) In this PHP function get the custom field wpcf-mobility field value:
https://developer.wordpress.org/reference/functions/get_post_meta/
Replace Semicolon with Comma:
hidden link
Then update wpcf-mobility field value
https://developer.wordpress.org/reference/functions/update_post_meta/