I have a requirement to slice "Dev" from below variable vmName in Azure logicapp
variable information :
When i tried with below approach/expression :
slice(split(variables('dsvmName'),'-'),1)
error : The template language function 'slice' expects its first parameter to be of type string. The provided value is of type 'Array'. Please see https://aka.ms/logicexpressions#slice for usage details.'.
Try this (untested) ...
split(variables('dsvmName'),'-')?[0]
That will retrieve the first item in the array when you split it by a hyphen.