You are not logged in.
When I use RetrieveListJson (SQLTable, '', [], '*') I get:
{"result":["[{\"ID\":1,\"Ativo\":1,\"Contatos\":\"ï¿°W3siTm9tZSI6IkFsbHlzb24gQm9yZ2VzIiwiVGVsZWZvbmVzIjpbeyJUaXBvIjoiQ09CUkFOQ0EiLCJEREQiOjgzLCJOdW1lcm8iOiI5NzQ3Ni0yNzg5In0seyJUaXBvIjoiRElSRVRPUklBIiwiREREIjo4MywiTnVtZXJvIjoiOTM0MjEtMjEzMyJ9XSwiRW1haWwiOiJhbGx5c29uQHguY29tIn0seyJOb21lIjoiRnJhbmNpc2NvIGRlIEFzc2lzIiwiVGVsZWZvbmVzIjpbXSwiRW1haWwiOiJhc3Npc0B4LmNvbSJ9XQ==\",\"Dados\":\"{\\\"LocalMapa\\\":\\\"\\\"}\"}]\n"],"id":1}
When I use RetrieveDocVariantArray (SQLTable, '', '', [], '*') I get:
{"result":[[{ID:1,Ativo:true,Contatos:null,Dados:{LocalMapa:""}}]],"id":1}
How do I retrieve the 'Contatos' field which is dynamic array using 'RetrieveDocVariantArray'?
Offline
Check https://synopse.info/files/html/Synopse … ml#TITL_26
The dynamic arrays are stored as BLOB, and expect the ORM to decode the binary content before process at runtime. There is no direct JSON serialization of dynamic arrays.
If you expect the content to be returned as JSON array, use a variant field and store a TDocVariant in it, or use TObjArray kind of dynamic arrays.
Offline
Thanks ab, using a variant field and assigning a dynamic array to the field, it worked.
Offline