I have a classic report rendering one column using the apex_switch item API, and I would like a dynamic action to capture click/change, and give me the relevant ID/value.

My SQL contains
APEX_ITEM.SWITCH(
p\_idx => 42
,p\_value => ie.my\_val
,p\_on\_value => 'Y'
,p\_on\_label => 'Include'
,p\_off\_value => 'N'
,p\_off\_label => 'Exclude'
,p\_item\_label => 'Include'
,p\_item\_id => 'include\_'||i.id
)
With an onClick DA using this jQuery selector
.apex-item-group--switch
And the following JavaScript action returns the values I need
console.log('val:'+$(this.triggeringElement).find('input[name=f42]').val());
console.log($('.apex-item-group--switch').find('input[name=f42]').prop('id').substr(8));
However, the action is triggered twice, once for each value
If I change the value, the browser console in debug mode returns:
Dynamic Action Fired: correspondence (NATIVE_JAVASCRIPT_CODE) {triggeringElement: div#include_837926_group.apex-button-group.apex-item-group.apex-item-group--switch, affectedElements: jQuery.fn.init(1), action: {…}, browserEvent: j…y.Event, data: undefined, …}
val:N
837926
Dynamic Action Fired: correspondence (NATIVE_JAVASCRIPT_CODE) {triggeringElement: div#include_837926_group.apex-button-group.apex-item-group.apex-item-group--switch, affectedElements: jQuery.fn.init(1), action: {…}, browserEvent: j…y.Event, data: undefined, …}
val:Y
837926
If I click on the same value, it still executes twice, but with the same value.
What should I adjust to have an action that only indicates the new value? Is there a cleaner way of accomplishing this task?
APEX 18.2
Cheers