The approach I'm trying to take is:
1. Create a collection of this number column's contents
2. Apply the Max function to the result
3. Set a variable equal to this value plus one, so it's effectively the next number in sequence
4. Pass this variable (and some other stuff) into a Flow for processing
My issue is that no matter what syntax or combination of commands I use, the Flow is receiving a "True" instead of some number. Here's the script:
ClearCollect(colReqNums, ShowColumns(PurchaseReq_1,"ReqNum"));
Set(varThisReqNum,Max(colReqNums,'ReqNum')+1);
PurchaseReq.Run(NewReqJSON,varCurrentUserEmail,varThisReqNum;
and alternatively
Set(NewReqJSON,JSON(varNewReq));
ClearCollect(colReqNums,Distinct(PurchaseReq_1,"ReqNum"));
Set(varThisReqNum,Max(colReqNums,Result)+1);
PurchaseReq.Run(NewReqJSON,varCurrentUserEmail,varThisReqNum;
PurchaseReq_1 is the data source name for my List. ReqNum is the column name.
Can someone please school me on whatever I'm missing? This general approach seems to work for others. I have looked over:
https://powerusers.microsoft.com/t5/Building-Power-Apps/Get-the-max-value-of-my-gallery/m-p/601928#M189245
https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-get-the-max-value-of-Sharepoint-list-column/m-p/386562#M112491