Error while trying to retrieve data from datastore2 dictionary

hi i cant retrieve data from datastore2 with certain index here’s the code

i’ve been hours to try to solve it and still cant find a solution, i have that script in a leaderboard, i have a local script called control that invokes a remote function and retrieve inventory table and when i try to access it said the error i shown in second image.

image

I solved the problem making the following things:
First every time i alter the table i change main key:


This is to clear previous saved data of player to avoid unexpected behavior

Then i setted numeric index in this order:

and done i now can acces items like this

currentItemType = “wheelChair” for example so i do:

returnedInventory[2][currentItemType].shopLvl

and done.