EXTRACT does not recognize Spanish dates

Hi,

I use  OCR function  to extract all the text of several invoices:

OCRTEXT( [FOTO_FACTURA])   where   [FOTO_FACTURA]  is an image field.

Once I get all text,  I put it in another field called [TEXTO_FACTURA].  Now I want to extract from [TEXTO_FACTURA] all DATEs values, all PRICEs values, all NUMBERs values and show them in different dropdown list using the EXTRACT functions:

EXTRACT("DATES", [TEXTO_FACTURA])

EXTRACT("NUMBERS", [TEXTO_FACTURA])

EXTRACT("PRICES", [TEXTO_FACTURA])

The problem happens when I retrieve the list of DATES using EXTRACT("DATES", [TEXTO_FACTURA]). 

 [TEXTO_FACTURA] contains the dates in spanish format (dd/MM/YYYYY) and the EXTRACT function seems to look for "MM/dd/YYYY" format.

For example:  

 [TEXTO_FACTURA]  contains  29 / 1 / 2020 and EXTRACT says  29 / 1 / 2020

[TEXTO_FACTURA]  contains  15 / 6 / 2021 and EXTRACT says  15 / 6 / 2020 

[TEXTO_FACTURA]  contains  10/ 9 / 2022 and EXTRACT says  9/ 10 / 2022 

[TEXTO_FACTURA]  contains  7 / 5 / 2021 and EXTRACT says  5 / 7 / 2021 

When the first element of the DATE is higher than 12, EXTRACT changes the order.

Is there a way to say EXTRACT function that the dates of the text are in "dd/MM/YYYY" format  ?

Regards

Solved Solved
0 3 126
1 ACCEPTED SOLUTION

Except for the specific patterns recognized by the EXTRACT() functions, AppSheet has no pattern-matching capabilities.

View solution in original post

3 REPLIES 3

Steve
Platinum 4
Platinum 4

I believe I asked about its locale support when the function was originally released. To my recollection, it is designed only for US English.

Hi Steve,

Thanks for your help.  

Sorry I am a beginner using Appsheet and  I need some more help.

If OCR function gives me the correct date format (dd/MM/YYYY) because we are analysing spanish invoices, is there a way in Appsheet to read the contents of [TEXTO_FACTURA] and get a LIST of all strings inside [TEXTO_FACTURA] with the pattern "$$/$$/$$$$" ?.      

For example, [TEXTO_FACTURA] holds the content of the invoice in text format, and in bold you can see the texts/strings I would like to extract into a LIST().  In every invoice the number of dates and the position will be different.

Facturar a
Jaime Lopez
Avda. Diagonal
08759 Barcelona, Barcelona
CANT.
1
2
3
Rojo Polo Paella Inc.
Carretera Muelle 38
37531 Barcelona, Barcelona
Enviar a
Leda Villareal
Cercas Bajas 68
47300 Cádiz, Cádiz
N° de factura ES-001
DESCRIPCIÓN
Talla pequeña traje de luces en rojo
Mui grande churrolito
El pago se realizará en un plazo de 15 días
Banco Santander
Fecha Comanda
25/01/2019
vencimiento
PRECIO
UNITARIO
100.00
25.00
5.00
Subtotal
IVA 21.0%
Fecha Factura
29/01/2019
IMPORTE
100.00
50.00
15.00
165.00
34.65
199.65 €
Laura Perez

I have seen some posts about looking for some strings in a text using SPLIT, INDEX, ...,  but I don't see how to get all the strings with the same pattern inside [TEXTO_FACTURA].   

Gracias.

 

Except for the specific patterns recognized by the EXTRACT() functions, AppSheet has no pattern-matching capabilities.

Top Labels in this Space