
Announcements
The execution of template action 'Select' failed: The evaluation of 'query' action 'where' expression '{
"Name": "@split(item(), '^')[0]",
"Email": "@split(item(), '^')[1]",
"City": ""
}' failed: 'The template language expression 'split(item(), '^')[1]' cannot be evaluated because array index '1' is outside bounds (0, 0) of array.
how can i resolve this error?
Hi @Akashdeep1,
It looks like in the e-mail field it cannot find the ^ character to split on. One of your values does not have that character, therefore the split will fail and it cannot return the second part of the split result.
You might want to incorporate if, equals and indexOf functions to check if the value actually contains a the split character before you starting splitting.
Below is an example for the Email value:
When the split character is not found the expression will present a custom message 'No split character found'
if(equals(indexOf(item(), '^'), -1), 'No split character found', split(item(), '^')[1])