Forums

referring to an Array element

dtws2008 04 Dec, 2015
Hello,
In my form, after the db read action I use a custom code action.
In the custom code I want to refer to an Array element of the retrieved record. How can I do this?
GreyHead 04 Dec, 2015
Hi dtws2008,

It will either be $form->data['column_name'] or $form->data['model_id']['column_name'] depending on whether you set a Model ID in the DB Read action.

Adding a Debugger action temporarily will show you the data available.

Bob
dtws2008 04 Dec, 2015
Hello Bob,
I need to update a $form->data['column_name'] by a calculation of some array elements that were retrieved by the DB read.
How to refer to the array elements? not the form fields.
dtws2008 04 Dec, 2015
Sorry, my mistake!
This helped me! Thanks a lot
GreyHead 04 Dec, 2015
Answer
1 Likes
Hi dtws2008,

As you have seen the DB Read data is added to the $form->data array in addition to the data from the form inputs.

Bob
This topic is locked and no more replies can be posted.