Buy Now
Sign in

How to retrive a value from the array

Proximate , February 19 at 11:46
Answered
P
Proximate
Hi
i've created a read_data function, if i write {var:read_data} it display's the whole array. Now, how can i access a value inside this array?
it looks like:
---
[{"Data":{"id":"1","package_id":"1","equipment_id":"1","equipment_amount":"4"},"Package":{"id":"1","package_size":"1","package_name":"All
in One
400","package_price":"400"},"Equipment":{"id":"1","equipment_name":"Soundanlage
Small (3000
Watt)","equipment_group":"1"},"Equipment_Group":{"id":"1","group_name":"Sound"}},{"Data":{"id":"3","package_id":"1","equipment_id":"2","equipment_amount":"55"},"Package":{"id":"1","package_size":"1","package_name":"All
in One
400","package_price":"400"},"Equipment":{"id":"2","equipment_name":"Soundanlage
Medium (4500
Watt)","equipment_group":"1"},"Equipment_Group":{"id":"1","group_name":"Sound"}}]
---
i tried already things like {var:read_data.Data}, Data.id {Data.id}, and some kind of {data.pr} (like described here)
All i get is the var text "as is" or nothing...
at the end i would like to use the repeater field with some HTML but for that i ned access to the vars.
i tried to insert the var texts above inside a repeater, inside an event - same behaviour - what i am missing?
parallel i created a table view for my checks...Bildschirmfoto_2018-02-19_um_12.44.48.png
P
Proximate
ok now i've seen i forgott the 0 like {var:read_data.0.Data} - but how can i "loop" throug the elements?
Bildschirmfoto_2018-02-19_um_13.18.34.png
Attachments
Bildschirmfoto_2018-02-19_um_12.49.02.png
Bildschirmfoto_2018-02-19_um_12.49.02.png
(114.51 KiB)
123 Downloads/Views
Bildschirmfoto_2018-02-19_um_13.18.34.png
Bildschirmfoto_2018-02-19_um_13.18.34.png
(229.49 KiB)
194 Downloads/Views
GreyHead
Hi Proximate,
I think that the Loop action will let you look through the array; see page 25 of the Manual.
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
P
Proximate
Hi GreyHead
Manual?
Where?
i've checked a couple of FAQ's but did not find any manual...
P
Proximate
Ok got it from the ChronoForms v6 Manual
Bildschirmfoto_2018-02-19_um_14.10.44.png
Attachments
Bildschirmfoto_2018-02-19_um_14.10.44.png
Bildschirmfoto_2018-02-19_um_14.10.44.png
(120.79 KiB)
190 Downloads/Views