Workflow - 'Substring' Operator within 'Define Variable' Operator

Hello @nhassan,

I was able to achieve this using two Define Variable operators. The first uses the getIndex operator to find the location of the first backslash. The Pattern regex used was [\\\\]

You will have to use the advanced tab as described here to change the patternGetIndex key to Pattern to get around the current UI bug.

The second Define Variable uses the result of the first variable to start at that index for the substring operator, by default the UI will create a length key. Using the Advanced tab you can remove that length key which tells the substring operator to return the rest of the string after the start index.

At this point I had a string with \\ description text. I used another substring with start:1 to remove the two slashes off the begging of the string.

TylerTest20231211

Full Workflow:

{
	"name": "Tyler Test",
	"description": "",
	"modified": "2023-12-11T19:04:36.453421602Z",
	"modifiedBy": {
		"type": "IDENTITY",
		"id": "2c918089796ba06c01798018af8d4161",
		"name": "tyler.mairose"
	},
	"definition": {
		"start": "Define Variable",
		"steps": {
			"Define Variable": {
				"attributes": {
					"id": "sp:define-variable",
					"variables": [
						{
							"description": "",
							"name": "Index",
							"transforms": [
								{
									"id": "sp:transform:getIndex:int",
									"input": {
										"Pattern": "[\\\\]"
									}
								}
							],
							"variableA.$": "$.trigger.requestedItemsStatus[0].name"
						}
					]
				},
				"nextStep": "Define Variable 1",
				"type": "Mutation"
			},
			"Define Variable 1": {
				"attributes": {
					"id": "sp:define-variable",
					"variables": [
						{
							"description": "",
							"name": "Substring",
							"transforms": [
								{
									"id": "sp:transform:substring:string",
									"input": {
										"start.$": "$.defineVariable.index"
									}
								},
								{
									"id": "sp:transform:substring:string",
									"input": {
										"start": 1
									}
								}
							],
							"variableA.$": "$.trigger.requestedItemsStatus[0].name"
						}
					]
				},
				"nextStep": "End Step — Success",
				"type": "Mutation"
			},
			"End Step — Success": {
				"type": "success"
			}
		}
	},
	"creator": {
		"type": "IDENTITY",
		"id": "2c918089796ba06c01798018af8d4161",
		"name": "tyler.mairose"
	},
	"trigger": {
		"type": "EVENT",
		"attributes": {
			"id": "idn:access-request-post-approval"
		}
	}
}