Quick Tip – Masking Phone Number

I had an interesting question posed to me recently. The customer was using a Model Driven app and wanted to format a 10-digit number as a phone number. I thought sure, create a JavaScript web resource and have it do its jazz after the user entered the 10-digit number prior to submission of the record.

The customer requested we use no code because they have a strict process for checking in code. So I suggested the following.

  1. Create a Power Automate flow that runs when a record is created or updated
  2. Write the following formula into phone number field: concat('(', substring(triggerBody()?['text'], 0, 3), ') ', substring(triggerBody()?['text'], 3, 3), '-', substring(triggerBody()?['text'], 6, 4))

Configuration of flow

The number being entered as 10-digit number minus formatting
Outputs

Leave a Reply

Discover more from Duke DeVan

Subscribe now to keep reading and get access to the full archive.

Continue reading