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
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.?
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
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.
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/
My issue is resolved now. Thank you!
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.
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/