Struggling with Saving and Retrieving Selected Rows in Local Storage

I'm trying to read the localStorage in the same app. But I don't know how to convert them to an array. It seems like accessing localStorage with queries in the same app is not possible in Retool.

I saw the following post addressing the same issue: Can't access localStorage from global functions

Any solutions?