Token class has two properties “token” and value". The reason I have to do this is “token1” and “token2” are not fixed named property like “token” in which case I would have only 1 property in my Token class. I am forced to have two properties so I can extract raw data on the lhs and rhs
For life of me I cannot figure out how to do the mapping.
I specified Top Element Structure as an “Array” because top level object is an array and not object
Then I selected “Primary.tokens” for PageList property. It gives me error below
Cannot reference another top-level page: Primary.errors Invalid property reference
Needless to say I selected “Objects” for “Elements of this JSON are”
Since I cannot get past above basic errors I am not able to try anything else. Like, figuring out how to specify the JSON on the RHS when doing manual mapping because “token1” and “token2” are not fixed.
I am starting to think maybe I need to massage the JSON or maybe not use JSON data transform. Would really appreciate any pointers.
@JayaL722 That is precisely the problem. It will not let me select my page list property unless I select “Primary” first and only then shows me the pagelist property property under it (in screenshot it says “errors” because I renamed “tokens” to “errors”). Hope I explained the issue now. Screenshots below
@JayaL722 Shoot! Okay yes. So now back to my real question. How do I parse random name value pairs in to multiple Error objects in my Errors Page List? As I stated earlier I will not know in advance the name is going to be “token1” or “token2” or whatever. Is there a logical way to refer to elements of each JSON object (i.e. { }). See screenshot below
@JayaL722 Okay so that is the issue. I do not know the “keys” in advance. In my original example I called the “token1”, “token2”, it could really be anything. Basically they are name value-pairs with both name and value only known at run time.
So either JSON data transform is not the right way and / or I need to see if there is some function availabl / or I have to write my own function.