setValue not working directly after selectRow

Thanks for clarifying GetMaxID! Relying on a newly selected row would have some complexity, but since we don't need that here, we should be able to sort out a solution

After some attempts Blake from the Retool team found the solution.
This is the code that works:

// Assuming GetMaxLicenserID.trigger() returns a Promise
const maxResult = await GetMaxLicenserID.trigger();
const max = maxResult[0].Max_Id; // Assuming it returns an array

console.log('max = ' + max);

// Make sure max is a number and increment it by 1
if (!isNaN(max)) {
numberInputLicenserID.setValue(max + 1);
} else {
// Handle the case where max is not a valid number
console.error('Max ID is not a valid number');
}

Thanks a lot Blake for your great help!