How to retrive a value from the array

access specific values within an array in ChronoForms.

Overview

The issue occurs when trying to retrieve individual elements from an array variable, as standard variable shortcodes only display the entire array.
Use the Loop action to iterate through the array elements, allowing you to access and display specific nested values within your form.

Answered
ChronoForms v6
Pr Proximate 19 Feb, 2018
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...How to retrive a value from the array image 1
Pr Proximate 19 Feb, 2018
ok now i've seen i forgott the 0 like {var:read_data.0.Data} - but how can i "loop" throug the elements?

How to retrive a value from the array image 2
Gr GreyHead 19 Feb, 2018
Hi Proximate,

I think that the Loop action will let you look through the array; see page 25 of the Manual.

Bob
Pr Proximate 19 Feb, 2018
Hi GreyHead
Manual?
Where?
i've checked a couple of FAQ's but did not find any manual...
This topic is locked and no more replies can be posted.