Use the GetTextBefore component

  • Release version: Australia
  • Updated March 12, 2026
  • 1 minute to read
  • Find the string characters that are placed before a string by using the GetTextAfter component in RPA Desktop Design Studio.

    Before you begin

    Role required: none

    About this task

    This method is used to extract text that precedes a specified find string up to a specified length. If the length is 0, it extracts text from the beginning of the string.

    You can configure the properties for the GetTextBefore component. For more information about these properties, see Properties of the String Utilities components.

    Procedure

    1. In the Toolbox pane, navigate to Utilities > String Utilities.
    2. Drag the GetTextBefore component to the Design surface.
    3. To configure the input fields, see Configure port properties.
    4. Connect the data and control ports of the GetTextBefore component to the corresponding ports of the other components as described in the following table.
      Port type Purpose of connection
      Data In (Text) Takes the text that the component searches from a previously executed component.

      Used to specify the string from where a sub string is extracted, starting at a position determined by a string match minus a specified length, and extending for a specified length.

      Data type: String

      Data In (findStr) Takes the string characters that the component finds in the text from a previously executed component.

      Used to specify the string that determines the starting position based on a string match.

      Data type: String

      Data In (length) Takes the number of characters that the component finds in the text from a previously executed component.

      Used to specify the number of characters to be extracted from a given string.

      Data type: Integer

      Date Out (Return) Returns the specified sub string.

      This method returns a string that is the text found before search string.

      Data type: String

      Control In Connects to the Control Out port of one or more components.
      Control Out Connects to the Control In port of another component or the default end component
    5. Optional: To test the component, under the DESIGN tab, click Run.