- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Retrieving properties from catenated SSM property
SSM VARIABLE VALUE IS "Test1|test2|test3|test4" - How to return ONLY one of the TEST# data?
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
"Test1|test2|test3|test4" < "Test1"|test2|"test3"|test4
or as split...
["Test1","test3"]
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
If you have a string like "Test1|test2|test3|test4" and you want to access a specific “Test#” value, you can do so by splitting the string by the “|” character and then accessing the index of the desired value.
Here’s an example in Python:
ssm_variable = "Test1|test2|test3|test4"
values = ssm_variable.split("|")
# To get "Test1"
print(values[0])
# To get "test2"
print(values[1])
# To get "test3"
print(values[2])
# To get "test4"
print(values[3])
In this code, split("|") breaks the string into a list where each element is a substring between the “|” characters. The print(values[i]) line then prints the value at index i of the list (remember that list indices in Python start at 0).
You can replace the index with the specific index of the “Test#” value you want to access. For example, if you want to get “test2”, you would use values[1] because “test2” is the second value in the list, and list indices start at 0.
Please replace the index with the one you need. If you’re using a different programming language, the concept will be similar but the syntax might differ. Let me know if you need help with a different language! ![]()
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
The LISP...
(defun split-string (delimiter string)
(loop for i = 0 then (1+ j)
as j = (position delimiter string :start i)
collect (subseq string i j)
until (null j)))
(let* ((ssm-variable "Test1|test2|test3|test4")
(values (split-string #\| ssm-variable)))
(print (nth 0 values)) ; To get "Test1"
(print (nth 1 values)) ; To get "test2"
(print (nth 2 values)) ; To get "test3"
(print (nth 3 values))) ; To get "test4"
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
![]()
![]()
![]()
Use substr function to extract a specific part. DIESEL does not have built-in functions to split a string by a diameter like "|". Therefore, to extract a specific ‘TEST#’ from your SSM variable, you would need to know the exact position and length of the ‘TEST#’ you want to extract.
$(substr, $(getvar, YOUR_VARIABLE_NAME), 7, 5)
In this expression, $(getvar, YOUR_VARIABLE_NAME) gets the value of your SSM variable, 7 is the start position of ‘Test2’ in the string (counting from 1), and 5 is the length of ‘Test2’.
Please replace YOUR_VARIABLE_NAME with the actual name of your SSM variable.
Remember that DIESEL has a limit of 10 parameters for all functions!!!!