Hi @Santa_Laren Hope you are doing good today.
I think that this can be solved in multiple ways, taking the example you mentioned, I used the string length and the substring and contact functions to process the input.
I think that this can also be done with Regular expressions, but for now I think that this can help.
Please insert a phone number = {formtext: name=Phone_number}
{if: len(Phone_number) == 10}Inserted Format = {=phone_number}
Second Format= {=concat(substring({=phone_number}, 1, 3),"-", substring({=phone_number}, 4, 3),"-" ,substring({=phone_number}, 7, 4))}
Third Format= {=concat("(",substring({=phone_number}, 1, 3),") ", substring({=phone_number}, 4, 3),"-", substring({=phone_number}, 7, 4))}{elseif: len(Phone_number) == 12}Inserted Format = {=phone_number}
Second Format= {=concat(substring({=phone_number}, 1, 3), substring({=phone_number}, 5, 3), substring({=phone_number}, 9, 4))}
Third Format= {=concat("(",substring({=phone_number}, 1, 3),") ", substring({=phone_number}, 5, 3),"-",substring({=phone_number}, 9, 4))}{elseif: len(Phone_number) == 14}Inserted Format = {=phone_number}
Second Format= {=concat(substring({=phone_number}, 2, 3), substring({=phone_number}, 7, 3), substring({=phone_number}, 11, 4))}
Third Format= {=concat(substring({=phone_number}, 2, 3),"-", substring({=phone_number}, 7, 3),"-", substring({=phone_number}, 11, 4))}{else}Please insert a valid phone number format {endif}
Please let me know if you have any question. Hope this helps.
Best regards,
Diego,