How to get the formatted data in report

I have a data field in my SQL database that stores a raw phone number like '9802408243'. Instead of using VARCHAR for the field at the SQL level.

In the report, I'd like to format it to appear as (980) 240-8243 because we won't always receive perfectly formatted data from our customers.

Comments

  • amershaik_Decisions
    edited June 25

    This can be achieved by using a Flow Inline Field to dynamically populate a report row via a flow.

    By fetching a row containing the unformatted number, we can pass it through the Flow Inline Field to format the number using the 'Split String By Character Positions' step. This step breaks down the string by its character positions and outputs it as a list. Next, using the 'Get Item By Index' step, we fetch the middle value and then reassemble the number into its expected format using the 'Merge Plain Text' step.

  • amershaik_Decisions
    edited June 25

    Flow Inline Fields can impose significant load on larger reports. While this isn't an issue for small datasets.

Sign In or Register to comment.