How can I get it MID() formula to show part of info before saving?

My user insert a hash or a sequence of 48 digits.
For example 846900000015259602962021103150630004002081451896

using this formula after saved value(MID(A1103;5;7)&mid(A1103;13;2)&","&mid(A1103;15;2)) get the amount of this bill R$125,96

826500000011699901066406457784431910522700000006

in this R$169,99

I´d like to check before save, if the user entry the same value of code or show the amount got in the code the user typed in order to check if the amount is the same of bill.

I was thought using a template and show the text box but I don’t now if I can use these formulas.
Thx

1 Like

Do you happen to know much about how the barcode is formulated? I know most barcodes have certain positions that mean different things, such as amount, account number, and other pieces of information…sometimes to control the machinery that folds the paper and stuffs envelopes…or mark the beginning and end of a batch of paperwork…or simply to to be scanned when payments are returned.

Do you happen to know what that number in the middle of the amount represents (the 5 in 152596 or the 1 in 116999). I would guess it’s some sort of check digit to verify the correct amount. Do you happen to know how that check digit is calculated?

Thx Jeff u r competly right. I know what´s each digit or block of them represents, but I dont know how to work with middle, left or right formula.

The formula that I sent is exactly how to get the amount of bill. so, I´d like to show to user, here it´s the amount of the code u´ve just written. That´s it. But again, I dont know how to work before saving.

Because I already do this in the GS, but I´d like to show, before save.
Thx again.

Btw there is a national layout of banks here in Brazil because this format of bill is accepted in all of states of Brazil.

I guess what I’m trying to understand is the structure of the barcode and how it’s created.

Something like this???

If I understand that, then I can understand how to generate that check digit in the middle of the amount and then insert it into the amount that the user entered. Once I have all of those pieces, then it would be easy to check if if the value (such as 00000011699) is included in the the barcode. The tricky part is that number that they insert into the middle of the amount.

The problem is that Glide does not currently offer any way to do string manipulation, such as MID, LEFT, etc. I’m working on a bit of a complicated math formula, but I’m not sure yet how reliable it will be. If I fully understood the structure of the barcode, then I think it would be better to build a value from what the user entered and then check that against the code.

Or if I could find out the type of barcode (since it sounds like it is a standard in Brazil), then I could do some searching in Google to find out more about it.

1 Like

Here, try putting this in a Math Column and see how consistently it works.

(
TRUNC(
TRUNC(

((Code / 100000000000000000000000000000000 / 1000000000000)
-
TRUNC(Code / 100000000000000000000000000000000 / 1000000000000))

*
1000000000000

)

/ 100000)


+


MOD(
TRUNC(

((Code / 100000000000000000000000000000000 / 1000000000000)
-
TRUNC(Code / 100000000000000000000000000000000 / 1000000000000))

*
1000000000000

)

/ 10000
,1)
)


* 100

Here's a screenshot of it in my data.

6 Likes

Oh my someone said u r genius! it’s truth! I’m gonna try later.

3 Likes

Sure we do.

3 Likes

Holy moly Jeff! I try not to be surprised, but it gets hard … haha you can always do it! Stunning man

3 Likes

I introduce you Mr Chuck “Jeff” Norris! :sunglasses:

4 Likes