I'm looking for a way to clear a phone field. Our users enter the telephone number as they see fit, sometimes with a hyphen, sometimes with brackets or other special characters. I would like to clean up everything for an output that is not a number or + sign, so that the output in a toolset view also works for a tel: link. Is there a useful way to do this with toolset?
Hello. Thank you for contacting the Toolset support.
There are two ways to fix the issue actually, I do not know yet how your users submit the telephone number value. Are you using Toolset Form that allows users to submit the telephone number? If yes:
You can use the Toolset Form's API hook cred_before_save_data that will run before the form content gets saved to the database and clean the telephone number value submitted by the user with your unwanted characters.
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_before_save_data
Do you mean you want to have two fields now where one field will contain the original value having those special characters and another field will contain the clean value (without those special characters)?
Are you using Toolset Forms where you are allowing user to submit the phone number or the phone number will be inputted from backend admin?
Correct. We have a field with the telephone number in a visually appealing format that our employees enter directly themselves. This could look like this: +(23) 231 - 123 34-34 - to use it for a link, all the disturbing characters would have to be removed. We do not use Toolset Forms - by way of exception - in this context. 🙂