lookup with leading zero

Dear All,

i have a sheet where i want to bring the "item code" of "item" from "item master sheet" aginst the item "Name", Where "Item Name" will be the lookup key and item code is in alphanumeric format.

lookup formula is working fine, but the problem i'm facing is those items which code has leading zero, appsheet removes the leding zero.

please help me on this.

0 7 167
7 REPLIES 7

Aurelien
Google Developer Expert
Google Developer Expert

Hi @chaman_sahu 


@chaman_sahu wrote:

lookup formula is working fine, but the problem i'm facing is those items which code has leading zero, appsheet removes the leding zero.


You may want to try setting the column type to Text instead of Number.

Aurelien_0-1675065439073.png

 

hi,

colum is spreadsheet and field type in appsheet is already formated as Text

Aurelien
Google Developer Expert
Google Developer Expert

Does your leading 0 value have an apostrophe before? Can you give it a try?

Yes it does, but omits the zero and keep the other values, e.g code is "0664" but when it saves to sheet is shows '664

Aurelien
Google Developer Expert
Google Developer Expert

That does not make sense. Can you please share a screenshot of your table structure both in AppSheet and Sheets ? And the table structure including the column where you have the lookup expression ?

As well, can you please share your lookup expression?

Was this resolved?  I have a similar issue where both fields are text and my leading zeros are being removed after a LOOKUP([Building], "Buildings", "Building Name", "Building ID").  Any advice?  Thanks.

After some testing, I managed to resolve this by changing the destination field in the excel sheet to "Text" type.  This was set to "General" type, which may be why the zeros were trimmed - likely by excel during storage.  Apparently, appsheet sends the string to excel and excel was trimming the zeros.  

Top Labels in this Space