0

I have extracted the following from a string and assigned it to arrPath , i.e.:

arrPath = "myArray[0]";

I also have an object path that points to a value but I need to take the value of arrPath and use this in my object path, i.e.

myPath.sheet.value.arrPath.info.status

Unfortunately this is not working for me as I basically need the path to look like the following:

myPath.sheet.value.myArray[0].info.status

in order to access the value.

I have had a look at other potential solutions but can't seem to locate one that will assist with my question.

ArthurJ
  • 777
  • 1
  • 14
  • 39
  • https://stackoverflow.com/questions/17683616/access-property-via-its-keypath-in-javascript – epascarello Mar 15 '22 at 02:35
  • @epascarello - I had a look over at the other SO thread you suggested and unsure how this relates to my question and how to apply to my situation? I just need to replace `arrPath` with it's value inside path. – ArthurJ Mar 15 '22 at 03:18
  • What you want to do is not possible. So you need to use the same idea in that code to look up the path of the object with the string you provide. – epascarello Mar 15 '22 at 03:19

0 Answers0