Formato RUT (DNI) Chile

Hola a todos!

Estoy trabajando en la integración de Shopify con la plataforma de venta/Inventario que utilizamos en mi empresa y no he podido configurar el RUT del cliente que viene desde Shopify.

Shopify no tiene un campo de RUT en su Checkout, por lo que estoy utilizando el campo del ZIP. El valor que se envía es un valor numérico y necesito formatearlo como RUT (DNI) Chileno que sería algo así: XXXX-X (Ejemplo: 16.012.123-4).

Saludos!

Hello everyone!

I am working on integrating Shopify with the sales/inventory platform that we use in my company, and I have not been able to configure the RUT of the client that comes from Shopify.

Shopify doesn’t have a RUT field in their Checkout, so I’m using the ZIP field. The value sent is a numeric value and I need to format it as Chilean RUT (DNI), which would be something like this: XXXX-X (Example: 16.012.123-4).

Greetings!

Hi @Rodolfo_Romero_Pena , you can create a function in Make that solves the problem you want to solve.

I share an example.

Input: 160560797
Output: 16056079-7

Function:
{{substring(1.rut; 0; length(1.rut) - 1)}}-{{substring(1.rut; length(1.rut) - 1; length(1.rut))}}

I hope it helps you.

Greetings

1 Like