Desmond Sim
Desmond Sim

Reputation: 211

power apps find the contain [value] in SQL column field and get last 3 digit to plus 1 and autonumbering

enter image description here

IN SQL table [SOP10100] - it have different type running SOPNUMBE,

I wish to add the numbering +1

First Record = MBO0000003

Next Record = MBO0000004

Now I only able to get last value with MBO0000002 with the below script.

Last(Filter(SOP10100,StartsWith(SOPNUMBE,"MBO"))).SOPNUMBE

= MBO0000002

May I know how add the number + 1?

Below when I write script it return me empty value

Right(Last(Filter(SOP10100,StartsWith(SOPNUMBE,"MBO"))).SOPNUMBE,3) 

Upvotes: 0

Views: 230

Answers (2)

Desmond Sim
Desmond Sim

Reputation: 211

  Text(
                    Value(Right(Trim(Last(Filter(SOP10100,StartsWith(SOPNUMBE,"MBO"))).SOPNUMBE),3))+1
                    ,"MBO0000000"
      )

I finally found the answer myself.

enter image description here

Upvotes: 0

AnkUser
AnkUser

Reputation: 5531

your field SOPNUMBE field is not consistent, it has MBO0000003 and also OSRW0000004 I tried to do something with your SOPNUMBE

Right(Last(SOPNUMBECollection).SOPNUMBE,4)

It gave me 0002 and then I checked if it is numeric or not

IsNumeric(Right(Last(SOPNUMBECollection).SOPNUMBE,4))

If it returns true that means I can add one number to it. This works for me.

Note SOPNUMBECollection is a local colleciton I created.

Field SOPNUMBE is Text field in my case, I think that is the same for you as well.

Upvotes: 0

Related Questions