Hi All,
In my Sql db Title column group of attachments are stored as batch 1, batch 2 so on.. I want to check through PowerFx max no of batch number stored in database then increment it. if it is Null then It should be batch 1 if it is batch 1 then stored as batch 2 and so on.... below code
// initialize batch counter
ClearCollect(batchCount, {value: 1});
// find the maximum batch number in the database
ClearCollect(
maxBatch, LookUp(myimages, !IsBlank(Title))
);
// check if the maximum batch number exists and increment it
If(
CountRows(maxBatch) > 0,
Patch(
batchCount,
First(batchCount),
{value: Value(Right(First(maxBatch).Title, 1)) + 1}
),
// otherwise increment the batch counter
Patch(batchCount, First(batchCount), {value: First(batchCount).value + 1})
);
In code : // find the maximum batch number in the database
ClearCollect(
maxBatch, LookUp(myimages, !IsBlank(Title))------ I have troubled find the max batch number in db . Also lookup function might not work in large dataset..... can anyone help it
Thanks,
Chiranjit