Noob can't get this to work , variable is behaving like a string

I’m new to and i’ve tried all day to get my code to work ,no luck
if i replace i with a number it works but if i use the variable it out puts this " Value: ${name [i][0]} "

Command: type
Target: id=2
Value: ${name [i][0]}

Command: executeScript_sandbox
Target return Number (${i}) + 1;
Value i

thank you for your time ,hopefully someone can help

Post url with page need to see the html to detect good xpath

try this
${name [${i}][0]}

Thank you for taking the time to answer that worked just fine