Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Confiforms Formatting Phone Number

Daniel C. Igbokwe August 2, 2022

I would like users to enter a 10 digit number and later have it formatted
e.g 1234567890 into (123) 456-7890. I have tried using the formatPattern virtual function with the field definition rules macro and the IFTTT rules macro but it isn't changing the format.

Function: formatToPattern((\d{3})(\d{3})(\d+), ($1) $2-$3)

 

Thank you

1 answer

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Community Champion
August 3, 2022

Hi @Daniel C. Igbokwe 

Trying to understand what is the problem really...

See my test (based on what I understand) - http://recordit.co/gNMoAm8Iab

And the storage format for the reference, just in case

<ac:structured-macro ac:macro-id="5b58ef92-b997-4b40-8c3e-e9e817468c0f" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">myform</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="08688d3f-4ea6-4a6f-9bcf-b8ecd240b883" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="f5bb9cb4-7298-4d8e-bbca-c114c9880778" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">t</ac:parameter>
<ac:parameter ac:name="fieldLabel">t</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="09346186-c87d-4e3f-b85c-22560f0ade76" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">myform</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="73a1ff86-a50d-4e47-81a8-0c0186530df3" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">t</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="e423cf1f-6dd2-44fb-a769-c037375ad4cc" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">t.formatToPattern((\d{3})(\d{3})(\d+), ($1) $2-$3)</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>

Alex

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events