Views:

Applies to Product - Power Automate


What’s happening?
The customer is experiencing an error when using the 'Substring' function in template language expressions, specifically receiving a message indicating that the parameters are out of range.


Reason:
The error occurs when the 'start index' and 'length' parameters provided to the 'substring' function are not valid, meaning they must be non-negative integers and their sum must not exceed the length of the string.


Resolution:

  1. Ensure that the parameters for the 'Substring' function are valid:
  2. Check that both 'start index' and 'length' are non-negative integers.
  3. Verify that the sum of 'start index' and 'length' does not exceed the length of the string being processed.
  4. Review the content being passed to the 'Find text position' function to ensure it is correctly formatted and that the string length is appropriate for the specified indices.
  5. If necessary, refer to the Azure Logic Apps/Power Automate documentation for the 'substring' function for further guidance on usage: https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#substring.