I have stored a value in a Variable. Its an ID, it looks like this 1-2823596-1 or CAT-R131-L6267. Now I need to write an expression which filters this ID based on the first value of the ID(i.e if it's number or alphabet). According to that I will put my choice router. Can anyone please let me know how to write this expression as I am relatively new to Mulesoft
tried with the given example but did't able to create
enter code here { a: payload.a match {
case is Object -> 'OBJECT'
case is String -> 'STRING'
case is Number -> 'NUMBER'
case is Boolean -> 'BOOLEAN'
case is Array -> 'ARRAY'
case is Null -> 'NULL'
else -> 'ANOTHER TYPE' }, b: payload.b match {
case y is Object -> { 'Type': { 'OBJECT' : y} }
case y is String -> { 'Type': { 'STRING' : y} }
case y is Number -> { 'Type': { 'NUMBER' : y} }
case y is Boolean -> { 'Type': { 'BOOLEAN' : y} }
case y is Array -> { 'Type': { 'ARRAY' : y} }
case y is Null -> { 'Type': { 'NULL' : y} }
else -> { 'Type': { 'ANOTHER TYPE' : payload.b} } }}
Also tried using substring
enter code here #[vars.reqTcpn == vars.reqTcpn[0..0] match[0-9]]
Required to check if the first value of the string is a character or number so that I can put a choice router