What about a Java Action to generate the next in sequence. Chat GPT is your friend, It probably requires some tweaking.
> Generate a Java function to get the next in a sequence 00, AA, AB, AC, AD, BA, BB, BC, etc
public class SequenceGenerator {
public static void main(String[] args) {
// Example usage
System.out.println(getNextInSequence("AD")); // Output: "AE"
System.out.println(getNextInSequence("ZZ")); // Output: "AAA"
}
public static String getNextInSequence(String current) {
// Convert the string into a character array for manipulation
char[] chars = current.toCharArray();
// Start from the last character and work backwards
int i = chars.length - 1;
// Iterate and increment the characters as needed
while (i >= 0) {
// If the character is 'Z', reset it to 'A' and move left
if (chars[i] == 'Z') {
chars[i] = 'A';
i--;
} else {
// Increment the character by 1
chars[i]++;
break;
}
}
// If all characters were 'Z' and now are 'A', we need to add another character at the beginning
if (i < 0) {
// The result will have one more character at the start (e.g., "ZZ" -> "AAA")
return "A" + new String(chars);
}
// Return the next sequence
return new String(chars);
}
}
you can make a microflow with a parameter number to convert for example 29 to AC
$Label = ''
While $Number > 0:
$Remainder = mod (number - 1, 26)
$Letter = substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ', Remainder, 1)
$Label = $Label + $Letter
$Number = floor(($Number - 1) / 26)
This is just a direction, please check the algorithm.
if you need it you can also create a microflow to convert AC -> 29.
Total microflow IncrementString is then
ConvertNumberToString(ConvertStringToNumber(source)+1))