Number increment if value same?

So i want a feature that if the new entry is same to earlier enter then set the new entry to 1

eg -

old entry :-
MM240424

new entry :-
MM1240424 or MM2404241

Pls help for code in mit app inventor

Thank You

Show your relevant blocks, what have you tried so far?

more examples needed, for us to understand the pattern.

And in your blocks, all the tag is hard-coded, so you only need to store 2 values, company and companyNo?

So to simplify i am using google sheets in my project.

Screenshot 2024-04-26 131337

As above u can see there are two columns

The column JobNo is related to the starting letter of the company name followed by the current date.

So, if the job no is same, then i want to display it as 1 or so on.

Screenshot 2024-04-26 131709

As u can see above the jobNo is totally same, which i dont want I want to set it as ES2504241 .

Hope u have understood my query..

To simplify dont look up for the visual code i had posted.

Thank You

Compare both texts and if equals, then append "1" to the second one:

what about there is another ES2504241? will it be ES25042411 or ES2504242?

Or just generate a unique 8 digit code for each job ?

But, yes, if the probability of having multiple repetitions is high, it would be better to try to generate a unique starting identifier.

It will go on increasing as 1, 2 , 3 and so on

I suppose this is the solution but one value of variable is stored in tiny db.

instead of 1 can we add 1 each time if value is same?

I have tried something but its showing error:-
Bad arguements to +
The operation + cannot accept the arguements:, ["ES"], [1]