Problem when trying to create new row where initial value is based on previous row

Hi, I am running in to problems where application refuses to set initial value of the new row equal to last (highest) value + 1 in the same column.

I have [Quote Ref. No.] column values being entered as values "23-1001, 23-1002, ..." where 23 represents the year 2023 and 1001 is quote counter. I want to have initial value for every new row equal to previous row value + 1 in order to not have duplicate entries. I already have validation set against duplicate entries already. 

Expressions work when testing but do not work in the app in a way that [Quote Ref. No.] is returned as 0 on null, so I only get 23- value part but cant get 1001+1 part to work.

This is an example for one of the expressions that I tried:

CONCATENATE(RIGHT(YEAR(TODAY()),2),"-",RIGHT([Quote Ref. No.],4))

where expression test result is showing 23-1001 correctly (there is only one Quote Ref. No. with value 23-1001 in the table) but app is showing "23-" as initial value without 1001 part.

Can anyone please help me figure out what am I doing wrong?

 

0 3 88
3 REPLIES 3

How is [quote ref no] defined? Is it another expression? Can you show some screenshots to demonstrate the issue and the config better?

See also: https://community.appsheet.com/t/serial-numbers-if-you-must/19325

"Quotes" is table name and "Quote Ref. No." is column in that table.

"Quote Ref. No." values are assigned by user as 23-1001, 23-1002, 23-1003 and so on where "23-" designates a year and "1001", "1002", "1003" number of quote in that year.

I have red your link and tried expression:

 CONCATENATE(RIGHT(YEAR(TODAY()),2),"-",MAX(LIST(NUMBER(RIGHT(Quotes[Quote Ref. No.],4))))+1)

Expression test shows result 23-1003 correctly as 23-1001 and 23-1001 values already exist in "Quote Ref. No." column.

But when I run the app and open up the form to create new Quote Ref. No. the initial value for that input is showing "23-1002" instead of 23-1003

Sorry to waste your time but I got it fixed by regenerating schema. I noticed that anything I added to the app didn't reflect in the app, like validate if expressions and now it all works.

Top Labels in this Space