For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Open sourceSupportFAQsDocs Home
DocumentationAPI referenceRelease notes
DocumentationAPI referenceRelease notes
  • Platform On-Prem
    • Overview
    • Navigate
    • Search resources
  • Apps
      • Overview
      • Navigate
        • Configure and manage tasks
        • Null vs. undefined values
        • Parallel branches
          • Overview
          • addDuration
          • arrayIncludes
          • arrayLastIndexOf
          • arrayPop
          • arrayToString
          • assign
          • calculateTimeDiff
          • charAt
          • charCodeAt
          • childjob
          • codePointAt
          • concat
          • concatArray
          • convertEpochToObject
          • convertTimeFormat
          • convertTimeToEpoch
          • convertTimezone
          • copyWithin
          • csvStringToJSON
          • deepmerge
          • delay
          • endsWith
          • ErrorHandling
          • evaluation
          • eventListenerJob
          • excelToJson
          • extractField
          • fill
          • FlattenJSONFormInput
          • getTime
          • includes
          • arrayIndexOf
          • indexOf
          • isArray
          • join
          • keys
          • lastIndexOf
          • length
          • length (string)
          • localeCompare
          • makeData
          • map
          • match
          • merge
          • modify
          • newVariable
          • normalize
          • objectHasOwnProperty
          • objectToString
          • padEnd
          • padStart
          • parse
          • parseInt
          • pop
          • push
          • pushToArray
          • query
          • repeat
          • restCall
          • reverse
          • runCode
          • search
          • setObjectKey
          • shift
          • slice (array)
          • slice (string)
          • sort
          • split
          • startsWith
          • stringValueOf
          • stub
          • substring
          • toLocaleLowerCase
          • toLocaleString
          • toLocaleUpperCase
          • toLowerCase
          • numberToString
          • toString (array)
          • toString (number)
          • toString (object)
          • toUpperCase
          • transformation
          • trim
          • trimEnd
          • trimStart
          • unshift
          • updateJobDescription
          • values
          • viewData
    • FlowAI
    • Itential Automation Gateway
  • Resources
    • Itential Academy
    • Version lifecycle
    • Itential MCP
    • Accessibility conformance
    • Get support
    • FAQs
LogoLogo
Open sourceSupportFAQsDocs Home
On this page
  • Potential use case
  • Properties
  • Example 1
  • Example 2
AppsStudioTasksTask reference

endsWith

Was this page helpful?
Previous

ErrorHandling

Next
Built with

The endsWith task searches a given string to determine whether a specified sequence of characters appears at the end. You can also limit the number of characters searched. The task returns true if the string ends with the characters, or false if they are not found. The original string is not changed.

To check whether a string begins with a specified sequence instead, use the startsWith task.

Potential use case

Use endsWith to check whether a filename ends with a certain extension. For example, to check whether filename.txt ends with .txt, run endsWith against your file list. A true result confirms the extension is present; a false result confirms it is not. You can also use the length parameter to limit the search to only the beginning portion of the list.

Properties

IncomingTypeDescription
strStringRequired. The string to search.
searchStringStringRequired. The characters to search for at the end of the string.
lengthNumberThe length of the string to search. If omitted, the full string is searched.
OutgoingTypeDescription
resultBooleantrue if searchString is found at the end; false otherwise.

Example 1

In this example:

  • str is "Hello world, welcome to the universe."
  • searchString is "universe."
  • length is not specified, so the entire string is searched.
  • The expected result is true.
endsWith task with searchString 'universe.' and no length limit

Example 2

In this example:

  • str is the same as example one.
  • searchString is "world".
  • length is specified — only the first 11 characters of the string are searched.
  • The expected result is true, because "world" is found at the end of the first 11 characters.
endsWith task with searchString 'world' and length set to 11