I have no problem with the 'action'.
(I would like to send email (the action) before profile display (the trigger), only if it is the first time that the viewer visit the profile)
So, i try a new cb query cb_visitors :
( SELECT COUNT(*) FROM `#__comprofiler_views` AS v WHERE v.`profile_id`= '[cb:userdata field="user_id" user="#displayed" /]' AND v.`viewer_id` = '[cb:userdata field="user_id" user="#me" /]')
This, return 0 if no visit between the viewer and the profile, and return 1 if already a visit between us (this seems to work)
and in the CB AutoAction CONDITIONS :
[cb:userdata field="cb_visitors" user="#displayed" /] equal 0
and it doesn't work.
So I try to understand the reason, I put on my email these data :
[cb:userdata field="cb_visitors" user="#me" /]
[cb:userdata field="cb_visitors" user="#displayed" /]
[cb:userfield field="cb_visitors" user="#me" /]
[cb:userfield field="cb_visitors" user="#displayed" /]
[cb_visitors]
With trigger BeforeProfileDisplay All are equal to 0 and with trigger AfterProfileDisplay All are equal to 1.
How to test (condition) the good value (real result of the query) ?