vanderbilt-redcap/auto-record-generation

Help implementing support for checkbox triggers.

aalshukri opened this issue · 5 comments

In the latest version (1.6) the release notes mention that the module "No longer supports checkboxes or repeatable fields because they worked inconsistently."

Support for checkboxes is functionality that I actually require of this module, and I am going to attempt to implement this feature (along with a few others).

@mmcev106 Do you have any further information that might help me find a solution/fix to this problem?

https://github.com/vanderbilt-redcap/auto-record-generation/releases/tag/1.6

@aalshukri, I think that is a question for the module's author. @moorejr5, what are your thoughts?

Sorry if that release note caused any confusion. The module will pipe data from checkboxes into the new record. That release note is specifically saying that you cannot trigger the creation of a new record based on the values entered into checkbox fields. For example, you cannot tell the module to generate a new record when "Option 2" is checked in a checkbox field.

Of course with all the data piping the module does, the checkbox fields in the source and destination projects need to be defined in the same way, with the same options and the same values.

I hope this resolves the situation. If not let me know.

Thanks for your quick reply.

Maybe I did not explain my use case clearly above. I would actually like to trigger the creation of a new record based on the value of a checkbox.

Scenario: form has a tickbox yes/no true/false. If true, then create new record in new project.

As far as I understood from reading the release notes, this feature has been removed. Or maybe it did not exist.

As I need this particular feature for my use case, my question would be, is this possible? or are there any limiting factors/tips for me to implement this myself?

We attempted to have the feature at one time, but was removed. I believe @mmcev106 was the one who actually pushed the change, so he may have more insight into the exact reasons why. But I can try give my reasons why I think it was dropped since it happened some time ago. I believe it was because checkbox fields are handled differently than almost any other field type, so trying to account for triggers was becoming too much of a hassle to do in a robust sense.

For example, how to define that the data trigger only counts if Option 1 and Option 4 are checked. Then accounting for if they both need to be checked, or only one of the two. Then what if the trigger needs to fire if it's ONLY those two checked, and no other options? It could end up being a fairly complex list of situations to account for, and trying to create an interface to allow the user to communicate those needs to the module. But as I said, that would just be my assumption on why it wasn't implemented fully.

At the end of the day we probably just agreed that if a trigger needed to happen, the project could always just have a "Create New Record with Module" yes/no field somewhere and just use that. It's a workaround for the situation, but I believe it was deemed sufficient for most situations that we were handling.

That's a fabulous recap @moorejr5, thank you! Much better than my memory on the topic...