Fixed placeholder for $repeatCounter

mirceat

Member
Hello,

Is there a placeholder to use in a where clause instead of $repeatCounter? I need to get the index of a dbjoin element in a repeat group and I don't know how. "Ajax update" is enabled for this dbjoin element.

upload_2023-12-27_10-48-46.png


Thank you
 
Any help here, please? The syntax $repeatCounter is still available in J4 + Fabrik Zeta?

What i need is to get the index of each repeated group so I can use this index in a query in a dbjoin element. In J3 I've created a calc element and add "return $repeatCounter" (Ajax calculation + Calc on repeat set to Yes), here in J4 doesn't seems to work anymore, 0 is displayed all the time.
 
Last edited:
The image you first posted is gone from our server. We have recently migrated servers and a few of these got dropped. Can you repost it please?
 
Sure, was just a printscren of the Where clause. I tried with a calc element to get the values of the $repeatCounter, also tried using $repeatCounter directly in the query, doesn't work.

1706010578288.png
 
friendly bump...$repeatCounter is still available for use in Fabrik elements? I just need to get the index value of a repeat group so I can use this value in a query, like index for the first repeated group is 0, second index is 1 and so on.

If there is another option to get this value for use in a query, please let me know
 
Can you change plugins\fabrik_element\calc\calc.php in line 94 and line 492

Php::Eval(['code' => $calc, 'vars'=>['data'=>$data, 'd'=>$data, 'formModel'=>$formModel]]);
to
Php::Eval(['code' => $calc, 'vars'=>['data'=>$data,'repeatCounter'=>$repeatCounter, 'd'=>$data, 'formModel'=>$formModel]]);
 
Thank you, the index is now displayed.

Just to be sure, it is possible to get the value of an element in a repeat group to be used in another element like a dbjoin element? So I can get the value of a calc element in the Where clause in a dbjoin element like "{thistable}.index = '{my_calc_element___name_raw}'?

"Ajax update" is enabled for the dbjoin element and "Ajax calculation" is set to On for the calc element+ "Calc on repeat"
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top