Dynamic String Replacement
Dynamic String Replacement
While the matcher feature is powerful, the real magic happens when you’re able to insert your own content or variables into a string. This is where dynamic string replacement comes in.
Dynamic replacements are performed with the following syntaxes (links to the relavent parameter documentation):
- Basic (String):
{{str: "I'm a randome string"}} - Basic with fallback:
{{str: "I'm a randome string"}}||Fallback string||}} - Number:
{{num: 123}} - Boolean:
{{bool: true}} - Function:
{{fn: [nested.function.key]|str: 'hi'|}} - Context Key/Value:
{{key: 'nested.data.key'}}
When it comes to the function and key types, they’re taken from the context object and functions object passed in respectively.