I need to iterate a json object.
i fund in documentation : https://docs.ninox.com/en/print/print-customization/repetitions/iterate-over-objects
ho to do, but i cant use this.
Any Help?
Have a nice day.
13 replies
-
can you post your code?
-
in relation with this part of documentation:
https://docs.ninox.com/en/print/print-customization/repetitions/iterate-over-objects
it is important part of my code this section of documentation.
------I need to create a function for logging.
i have a object : let myObject:={ myObject : { paul : '10', jack : '20', bob : '30' } }
i create a function :
function createLog(object:any) do
let mylog:="";
let sep:="|";
for i in range(0,cnt(object.log)) do
log:=log+"
"+ DateTime+sep+object.log[i].att+object.log[i].val+.......
end;end
Yes i can send a array, but i want play with json object.
-
is the code below what are you looking for?
let Data := { myObject: [{ paul: "10" }, { jack: "20" }, { bob: "30" }] }; join(for i in Data.myObject do text(Data.myObject.i) end, ",")
the above inside a function field results in:
{"paul":"10"},{"jack":"20"},{"bob":"30"}
-
You can also use this code to get a list of your Json:
let myobject := { myObject: { paul: 10, jack: 20, bob: 30 } }; for name, value in myobject.myObject do name + ":" + value end
The result of this is:
paul:10,jack:20,bob:30
-
Yes, correct.
Content aside
- 7 mths agoLast active
- 13Replies
- 277Views
-
4
Following