When you are not familiar with PHP and WordPress programming, the right thing to do would be to either consult forums where PHP help is given, or the WordPress forum, or our consultants https://toolset.com/contractors/.
This is because Toolset Support can only give limited assistance (in the margin as Shane already provided it).
https://toolset.com/toolset-support-policy/
WordPress supports adding categories, which are the native taxonomies used on Posts, with wp_update_post, as you can see here in the source code:
https://developer.wordpress.org/reference/functions/wp_update_post/
But you need to add a custom taxonomy, and likely to a custom post in a Toolset Form, so you need to use what Shane suggested - https://developer.wordpress.org/reference/functions/wp_set_post_terms/
While you can consult on the WordPress developer DOC how to use that method, you can see below an example and the DOC about the Forms API to use.
I would use cred_save_data() here and hook wp_set_post_terms in it.
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
add_action('cred_save_data', 'my_save_data_action',10,2);
function my_save_data_action($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==12)//Change this ID to the Form ID you use
{
//All this inside here is custom code
//Here you could update a post, or do whatever other custom action you want. For example, wp_set_post_terms()
//https://developer.wordpress.org/reference/functions/wp_set_post_terms/, which is clarified about how to use it in the doc.
//note that the cred_save_data API already provides you with the Post ID so you do not need to find that - you can use $post_id
//Then the WP Codex says that there should be a string or array of $tags, meaning an array of terms to set for the post, or a string of terms separated by commas, which should be Term IDs usually. For example like below. Then it also goes on explaining that you should pass the actual taxonomy they should belong to as a string, which I already as well did below in the example. Ultimately you finish the method with the $append argument, which can be true or false (I left it empty, so it is set by default to false), which will decide whether add new terms to the post keeping existing or deleting existing.
wp_set_post_terms( $post_id, '1, 2', 'your_taxonomy' )
}
}