Add a Manually Trigger a Flow trigger with a number input field.
Use a Compose action to convert the input number to a string if it’s not already a string. - string(triggerOutputs()?['numberInput'])
Initialize Variables: - Create a String variable SequentialCheck and set it to true (initial assumption that the number is sequential). Create a Number variable i and set it to 0 (for iterating through digits).
Create a Loop to Check Digits: Add a Do Until loop: Condition: i >= length(outputs('Compose')) - 1 This ensures the loop stops before the last digit comparison.
Inside the Do Until loop - Use Compose actions to extract the current digit and the next digit
Current Digit - substring(outputs('Compose'), variables('i'), 1)
Next Digit - substring(outputs('Compose'), add(variables('i'), 1), 1)
Use a Condition action to check if the difference between the next digit and the current digit is 1: equals(sub(int(NextDigit), int(CurrentDigit)), 1)
If the condition is false: - Set the SequentialCheck variable to false. Add a Terminate action to exit the loop (optional).
Increment Counter: - Add a Set Variable action to increment i by 1 after each iteration - add(variables('i'), 1)
After the loop, add a Condition to check the value of SequentialCheck - If true, the number is sequential. If false, the number is not sequential.