Hi @Anonymous ,
Another idea as you are always dealing with the current year, this will give you up to 2,000 in the year. CountRows is simply not Delegable (nor is Year). You will also not get a Delegation warning here, but if the current year goes over 2,000 records, your count will be wrong.
'SW ApplicationNumber':
Text(Year(Now()) & "-" &
With(
{
wList:
Sort(
SW_Details,
'Date Application received',
Descending
)
},
Text(
CountRows(
Filter(
wList,
Year('Date Application received') = Year(Today())
)
) + 1,
"00000"
)
)
Or you could grab the last app no field entered, get the number part and add 1
'SW ApplicationNumber':
Text(Year(Now()) & "-" &
With(
{
wList:
Sort(
SW_Details,
'Date Application received',
Descending
)
},
With(
{wLastNo:Last(wList).'SW ApplicationNumber'},
Text(
Value(
Right(
wLastNo,
Len(wLastNo) - 5
)
) + 1,
"00000"
)
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps