Hi! I have been struggeling with this for quit a while now. I found some forum posts about this, but still can not seem to get this to workt. I think I am missing something...
We have a repeatable area 'area_repeater33' that has 4 'sub' fields:
gezin[{var:area_repeater33.key}[achternaamnaam_gezinslid]
gezin[{var:area_repeater33.key}]voornaam_gezinslid
gezin[{var:area_repeater33.key}][geboortedatum_gezinslid]
gezin[{var:area_repeater33.key}][email_gezinslid]
These fields can be repeated by the user. this works OK. In the debugger we see:
[pre][gezin] => Array
([br] [0] => Array[br] ([br] [achternaam_gezinslid] => 123[br] [voornaam_gezinslid] => 123[br] [geboortedatum_gezinslid] => [br] [email_gezinslid] => [br] )[br] [1] => Array[br] ([br] [achternaam_gezinslid] => 456[br] [voornaam_gezinslid] => 456[br] [geboortedatum_gezinslid] => [br] [email_gezinslid] => [br] )[br] )[/pre]
So the data seems to be present. In this test we used two sets of fields and we left the third and fourth fieds empty...
Now we need tot get this data in the email.
We created a 'Loop' action:
Name: loop9
Data provider: {data:gezin)
Loop body:
Test: {var.loop9.row.achternaam_gezinslid}
The body only contains one of the values for testing purposes.
The event is set to return the value as a var.
In the email we used:
{var:loop9}
This produces this strin in the e-mail body text:
Test: {var.loop9.row.achternaam_gezinslid}Test: {var.loop9.row.achternaam_gezinslid}
I do see two items are looped. But the actual needed value is not there.
Can someone help us to get this working?
As an alternative we could maybe use a PHP action to loop throught the array and create a string and set this as a new variable. I tried that as well, but also did not get that to work...
Kind regards,[br]Jip
We have a repeatable area 'area_repeater33' that has 4 'sub' fields:
gezin[{var:area_repeater33.key}[achternaamnaam_gezinslid]
gezin[{var:area_repeater33.key}]voornaam_gezinslid
gezin[{var:area_repeater33.key}][geboortedatum_gezinslid]
gezin[{var:area_repeater33.key}][email_gezinslid]
These fields can be repeated by the user. this works OK. In the debugger we see:
[pre][gezin] => Array
([br] [0] => Array[br] ([br] [achternaam_gezinslid] => 123[br] [voornaam_gezinslid] => 123[br] [geboortedatum_gezinslid] => [br] [email_gezinslid] => [br] )[br] [1] => Array[br] ([br] [achternaam_gezinslid] => 456[br] [voornaam_gezinslid] => 456[br] [geboortedatum_gezinslid] => [br] [email_gezinslid] => [br] )[br] )[/pre]
So the data seems to be present. In this test we used two sets of fields and we left the third and fourth fieds empty...
Now we need tot get this data in the email.
We created a 'Loop' action:
Name: loop9
Data provider: {data:gezin)
Loop body:
Test: {var.loop9.row.achternaam_gezinslid}
The body only contains one of the values for testing purposes.
The event is set to return the value as a var.
In the email we used:
{var:loop9}
This produces this strin in the e-mail body text:
Test: {var.loop9.row.achternaam_gezinslid}Test: {var.loop9.row.achternaam_gezinslid}
I do see two items are looped. But the actual needed value is not there.
Can someone help us to get this working?
As an alternative we could maybe use a PHP action to loop throught the array and create a string and set this as a new variable. I tried that as well, but also did not get that to work...
Kind regards,[br]Jip
{var: not {var.
Hello,
Have you found a solution to use the fields of the repetarer in php.
thank you for your reply.
Nadia
Have you found a solution to use the fields of the repetarer in php.
thank you for your reply.
Nadia
I find solution :
[Guest] => Array
(
[1] => Array
(
[firstname] => Dupon
[lastname] => Henri
[email] => Dupon@laposte.net
[phone] => 0236585469
[photo] =>
)
[2] => Array
(
[firstname] => Fernad
[lastname] => Hugue
[email] => Fernad@laposte.net
[phone] => 12369852145
[photo] =>
)
#PHP
<?php
echo $this->data['Guest'][1][firstname];
echo $this->data['Guest'][1][lastname];
echo $this->data['Guest'][2][firstname];
echo $this->data['Guest'][2][lastname];
This topic is locked and no more replies can be posted.