Assigning Value as the Variable, is it Possible?

I am trying to set the value as a variable. For clarification I have a value for the variable “lineItem1ProductCode” set as 1111, but I need it to then loop through and input the value for the variable “lineItem2ProductCode”.

I set up an “Assign value to variable” to " lineItem${t + 1}ProductCode; " which gives me the value of “lineItem1ProductCode” when t=0.

Is there a way to set a variable to get the value of another Variable using the value of the variable?

Found out how to change a value and get a value for a variable within a loop so that every time it loops it finds what the value should be.

Using the “Assign a Value” activity I used the code: _.get(fields, lineItem${t + 1}ProductCode, ‘’);