Skip to content

String Manipulation ​

If you want to modify the value of any text or any field in the page, then you can use this String Manipulation Field Type. This powerful field type allows you to transform, clean, and manipulate text content in various ways.

String Manipulation

Field Options ​

Element Selector Query ​

You can set target element selector query in the field.

You can find the element selector query by right-clicking on the element and selecting "Copy Element Selector Address" or "Copy Element XPath Selector Address".

Which element option needs to be changed? ​

Choose what type of content you want to replace or modify:

OptionDescription
Element TextReplace the visible text content of the element
Element ValueReplace the value attribute of input elements
Element HTMLReplace the entire HTML markup of the element
Element AttributeReplace a specific attribute value
Field NameReplace content in a specific field by name

Element Attribute ​

  • Element Attribute Name: Specify which attribute to replace (e.g., src, href, data-id, class)

Field Name ​

  • Field Value: Enter the name of the field you want to target for replacement

Text Cleaning Options ​

OptionDescription
Remove Extra SpaceRemove multiple consecutive spaces and replace with single space
Remove All SpaceRemove all spaces from the text
Remove All StringRemove all text content (leaves empty string)
TrimRemove leading and trailing whitespace

Case Conversion Options ​

OptionDescription
Convert to LowercaseConvert all text to lowercase letters
Convert to UppercaseConvert all text to uppercase letters
Convert to Title CaseConvert text to title case (first letter of each word capitalized)

Replace String with RegEx ​

Advanced text replacement using regular expressions.

OptionDescription
Regular ExpressionThe regex pattern to match text for replacement
Replace StringThe text to replace matched patterns with

Example Usage ​

If you want to change this "Ben002" string into this "002_g.pdf" then you can use this type of RegEx.

String Manipulation

Regex Pattern: Ben(\d+)
Replace String: $1_g.pdf
Result: Ben002 → 002_g.pdf

Save New Value Option ​

  • Do you want to save the new value in the field?: An on/off option. When enabled, the newly manipulated value is saved directly to the field, allowing other actions or variables to refer to this updated value.

Usage Examples ​

Basic Text Replacement ​

  1. Which element option needs to be changed?: Element Text
  2. Target: Select the element containing the text to replace
  3. New Content: Enter the replacement text
  4. Result: The visible text will be updated

Attribute Value Replacement ​

  1. Which element option needs to be changed?: Element Attribute
  2. Element Attribute Name: href
  3. New Value: Enter the new URL
  4. Result: The link's href attribute will be updated

Text Cleaning ​

  1. Remove Extra Space: Enabled
  2. Trim: Enabled
  3. Convert to Title Case: Enabled
  4. Result: Clean, properly formatted text

Advanced Regex Replacement ​

  1. Replace String with RegEx: Enabled
  2. Regular Expression: (\d{4})-(\d{2})-(\d{2})
  3. Replace String: $3/$2/$1
  4. Result: 2024-12-25 → 25/12/2024

Common Use Cases ​

Data Formatting ​

  • Date Format Conversion: Change date formats using regex
  • Number Formatting: Add commas, currency symbols, or decimal places
  • Phone Number Formatting: Standardize phone number formats

Content Cleaning ​

  • Remove Extra Whitespace: Clean up messy text content
  • Standardize Case: Ensure consistent text casing
  • Remove Unwanted Characters: Strip out special characters or symbols

Dynamic Content Updates ​

  • Update Links: Change href attributes dynamically
  • Modify Form Values: Update input field values
  • Replace Text Content: Change displayed text based on conditions

Advanced Features ​

Regex Patterns ​

  • Pattern Matching: Use complex regex patterns for precise text matching
  • Capture Groups: Use $1, $2, etc. to reference captured groups
  • Global Replacement: Replace all occurrences of a pattern
  • Case-Insensitive Matching: Use regex flags for flexible matching

Important Notes ​

Element Selection ​

  • Ensure the target element exists before applying string manipulation
  • Use appropriate selectors to target the correct element

Regex Safety ​

  • Always test regex patterns with sample data first
  • Be careful with greedy patterns that might match too much text
  • Use escape characters for special regex characters

Next Steps ​