Custom Number Format like Brazil CPF (000.000.000-00) or CNPJ (00.000.000/0000-00

Please!
I would like to know how to show numbers in my appsheet app with these kind of formats?
I have numbers like 14790156877 and I want to show it in the app like 147.901.568-77 . How can I do that?

0 8 2,406
  • UX
8 REPLIES 8

You will need to use a combination of left/right and concatenate functions. Below is a document describing the different text functions available. If you need help with the final expression, just post again here.

Thank you John!
But I need to input only numbers and show it with that mask. Is it possible?

Yes, it is possible. Currently input/display masks don’t exist in AppSheet.

But there is a simple way around this. You can add a Virtual Column that applies your mask and is used only for display. In that Virtual Column, you would create an expression formula using the left/right and concatenate functions mentioned earlier that takes the number from the input field and generates the displayable text. You end up with two columns, the raw input number and a Virtual Column with the displayable text that has applied the display mask to the number.

In the app you can then choose which column you want to show through the use of Slices. For example, you may want a table that shows all of the entered rows but you only want to see displayable text. You would create a Slice that includes the Virtual Column but excludes the column with the raw number. Then use that Slice for the Table view.

There is an alternative approach to enter the full text and then validate it matches the expected format. This might be an option if you don’t care about using the raw number anywhere.

Thanks John!
I already get this implemented, but when edit form is created it takes only that field that was showed, isn`t it?


2X_4_42a0ab1f68ea0ef3f597197373c8450324414f61.gif

Remetente notificado por

                [Mailtrack](https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&)
                01/10/19 12:44:33

The Edit Form is the same as the Input Form, unless you changed it. So, it should use the same column as was used when the entry was made. If it was a raw number column, then that is what is shown for Edit. Any changes made will automatically be updated by the Virtual Column, applying the display mask.

Thanks John! I will try it!


2X_4_42a0ab1f68ea0ef3f597197373c8450324414f61.gif

Remetente notificado por

                [Mailtrack](https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&)
                01/10/19 13:45:02

how about, you got it ?

CPF how don ‘t konw doing konw you me