Selected fields for repeating events

295 views
Skip to first unread message

Sonia Picht

unread,
Oct 14, 2023, 12:57:41 PM10/14/23
to redcap open
Hola! Fellow REDCap people!
I hope all is well with you!

I am working on a REDCap design right now.
Basically I don't want to alter the flow of questions for the first baseline survey while I have to ask only selected questions for the next survey.
So I will have to break down a string of questions into fragmented instruments.

Is there a way to ask only selected fields depending on the defined events?

Thanks!

Have an awesome day!

Sonia



David Edwards

unread,
Oct 14, 2023, 6:22:47 PM10/14/23
to Sonia Picht, redcap open
Hi Sonia,
I might be misunderstanding what you need here but if you wanted to hide certain questions on an instrument depending on what event it appeared under, you could use the @IF() action tag on said fields like this:

@IF([event-name]='my_event_arm_1', @HIDDEN, '')

If there are more caveats you can nest those @IF(action tags). I've not actually tried this out so might take a bit of experimentation but it should work.
Good luck,
David.

From: redca...@googlegroups.com <redca...@googlegroups.com> on behalf of Sonia Picht <sonia...@gmail.com>
Sent: 14 October 2023 16:57
To: redcap open <redca...@googlegroups.com>
Subject: Selected fields for repeating events
 
--
You received this message because you are subscribed to the Google Groups "redcap open" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redcap_open...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redcap_open/a036720d-ef99-4132-958b-d591f30a6108n%40googlegroups.com.

Sonia Picht

unread,
Oct 14, 2023, 8:47:58 PM10/14/23
to redcap open
Yes yes!!! This will work!!!
Thank you so much for helping me, David!

Sonia

Peter Macisaac (POP)

unread,
Oct 15, 2023, 6:37:25 AM10/15/23
to Sonia Picht, redcap open
You can also hide questions using display logic

On top of head it seems that display logic and @hidden action tag perform the same function

Wonder if others can think of any advantage of using one over the other

Peter

Sonia Picht

unread,
Oct 15, 2023, 9:41:13 AM10/15/23
to Peter Macisaac (POP), redcap open
Peter,

Thank you so much!!!!
As of now, what David told me - IF/HIDDEN action tag- works great. 
But I will try display logic as well. 
Thank you, Peter!!!!

Sonia

Sent from my iPhone

On Oct 15, 2023, at 3:37 AM, Peter Macisaac (POP) <pe...@macisaacinformatics.org> wrote:

You can also hide questions using display logic

David Edwards

unread,
Oct 15, 2023, 10:55:00 AM10/15/23
to Sonia Picht, Peter Macisaac (POP), redcap open
I'm glad it worked Sonia - but I would definitely try what Peter suggested instead - because that's the built-in way to show/hide stuff in REDCap based on conditions - I'm a bit embarrassed I didn't think of that first! But thanks Peter for picking that up.
All the best,
David.

Sent: 15 October 2023 13:40
To: Peter Macisaac (POP) <pe...@macisaacinformatics.org>
Cc: redcap open <redca...@googlegroups.com>
Subject: Re: Selected fields for repeating events
 

Sonia Picht

unread,
Oct 15, 2023, 11:48:10 AM10/15/23
to redcap open
David and Peter,

I just looked into display logic. Display logic is selecting certain "instruments" per event. What I wanted to display in a certain event is selective "fields" within instruments. 
So for my need this time, I will use "IF/HIDDEN" action tag, because I do not want to break a set of questions into multiple instruments.

Thank you both, David and Peter!!

This community is really helpful. 
While REDCap is a great tool, searching for the specific application is often hard to figure out without any help.
I truly appreciate your help.

Thank you!!!!!

Sonia

David Edwards

unread,
Oct 15, 2023, 3:16:07 PM10/15/23
to Sonia Picht, redcap open
Hi Sonia - just a quick one from me - I think Peter meant branching logic, not form display logic.
So whatever conditions you were putting in the @IF() action tag, you could take and put in the branching logic for those fields instead. However, please bear in mind that branching logicworks in revers  to the @IF/@HIDDEN tges - so you need to give it the condition for the fields to be visible, rather than hidden.

So for example if you had the following condition on a yes/no field ...  @IF(([field1]='0' or [field1]=''), @HIDDEN, '') ... then you would need to put this in the branching logic ... [field1]='1'

or you could just put brackets around the whole thing and put an exclamation mark at the front to achieve the same thing !([field1]='0' or [field1]='')

Again, forgive me for giving you a bit of a bum steer in my first answer. I hope I havent confused things too much. But as Peter advised, I think branching logic is definitely the way to go for this.

All the best,
David.

Sent: 15 October 2023 15:48
To: redcap open <redca...@googlegroups.com>

Sonia Picht

unread,
Oct 15, 2023, 6:15:39 PM10/15/23
to redcap open
David,

Thanks so much for giving me one more way to implement it. 
I tried and changed all action tags into branch logic, and yes! they work well.
I will keep the branch logic way, because I can see it in the field editor (designer) as opposed to action tags don't show the logic details.
I really appreciate your help.

Thanks!!!!!

Sonia

David Edwards

unread,
Oct 15, 2023, 6:40:24 PM10/15/23
to Sonia Picht, redcap open
Oh good I'm glad that worked. Thanks to Peter for spotting that.
Cheers,
David.

Sent: 15 October 2023 22:15

Rain Bosworth

unread,
Oct 15, 2023, 6:45:29 PM10/15/23
to David Edwards, Sonia Picht, redcap open

Hi, I have been following this thread because I am trying to do a similar @if action, instead the following:

 

If any one of four consent forms is signed by both subject and researcher, deploy four background questionnaire survey for them to fill out… easy….

But then, if a 2nd consent form is signed (like a participant joins a 2nd study), do not deploy a survey that has already been completed.

 

I assume this is:  if [instrument-name] is not blank or status is incomplete, send in the ASI?  What script would I use for that?

 

Thanks

Rain

--
You received this message because you are subscribed to a topic in the Google Groups "redcap open" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/redcap_open/JGEFcLz8hGs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to redcap_open...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redcap_open/DB9P193MB12575188B98F50CFEFB8F04BBFD0A%40DB9P193MB1257.EURP193.PROD.OUTLOOK.COM.

Sonia Picht

unread,
Oct 15, 2023, 7:54:09 PM10/15/23
to redcap open
Hi Rain! 

I think you can use branch logic to open up the questionnaire.

[consent_1] = '1' OR [consent_2] = '1' OR [consent_3] = '1' OR [consent_4] = '1' 

The questionnaire will show only once.

Let me know if this answers your question.

Sonia

Peter Macisaac (POP)

unread,
Oct 16, 2023, 2:17:12 AM10/16/23
to Sonia Picht, redcap open
Yes I did mean branching logic -  apologies for senior moment

As David points out branching logic is designed to do this job and there is I think a range of background logic and support that helps us use this function - I would us this before @HIDDEN for your needs

I often use the hidden field that covers the form status
 {form_name_complete]

If a survey is finished it is marked as complete - this is a way to know if an instrument has been opened and completed

[assessment_complete]
Section Header: Form Status
Complete?
dropdown
0Incomplete
1Unverified
2Complete

Peter



Jean Tittley

unread,
Oct 16, 2023, 8:24:37 AM10/16/23
to redcap open
Hi Rain

If I’m right, your issue is to prevent opening a survey that has already been completed, and this can be managed independently of any other form (your consent forms). In the form display logic, I would try this condition for keeping forms active :

[[instrument-name]_complete] <> '2'

In fact I don’t know if the brackets into brackets will work. If not, you throw away the smart variable instrument-name and you it separately for each form, and I guess it will do the job.

Hope this helps

Jean

Sonia Picht

unread,
Oct 16, 2023, 12:20:39 PM10/16/23
to redcap open
Peter, 

Thanks!
Yes, both branch logic and Action tag works for my purpose, and I use branch logic.
Thank you.
Reply all
Reply to author
Forward
0 new messages