# How to Get the Last Response from the Current Session

**URL:** <https://forum.avicennaresearch.com/t/how-to-get-the-last-response-from-the-current-session/1547>\
**Category:** How-To\
**Tags:** how-to:activity\
**Created:** [June 15, 2026, 2:54pm UTC](https://forum.avicennaresearch.com/t/how-to-get-the-last-response-from-the-current-session/1547 "2026-06-15T14:54:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leila](https://forum.avicennaresearch.com/letter_avatar_proxy/v4/letter/l/b4bc9f/32.png) [@leila](https://forum.avicennaresearch.com/u/leila)\
**Post date:** [June 15, 2026, 2:54pm UTC](https://forum.avicennaresearch.com/t/how-to-get-the-last-response-from-the-current-session/1547/1 "2026-06-15T14:54:35Z")

</div>

In experience sampling or **longitudinal studies** , researchers often want to show or hide questions based on how a participant answered earlier in the same [session](https://forum.avicennaresearch.com/t/activity-sessions/1235).

By default, Avicenna looks at all sessions (including past ones) to find the last existing response submitted by a participant. If a question is skipped or hidden in the current session, Avicenna might “look back” to previous sessions and use an old answer to evaluate your [criteria](https://forum.avicennaresearch.com/t/criteria/1236). This guide explains how to ensure your logic only considers the current session.

## The Situation

You are running a \*\*Daily Mood Check-in survey.

- **Q1** asks: “Do you feel overwhelmed?” (Yes/No).
- **Q2** (shown only if `Q1 == Yes`) asks: “Rate your stress level (1-10).”
- **Q3** (shown only if `Q2 > 5`) asks: “Do you want to contact support?”

**The Problem:**  
Yesterday, the participant answered “Yes” to Q1 and “8” to Q2.  
Today, the participant answers “No” to Q1. Consequently, Q2 is hidden (not asked). However, Avicenna might still see the “8” from yesterday’s Q2 and incorrectly show Q3 today.

## What to Do?

To prevent this, you must “chain” your conditions so that a dependent question only appears if the _entire_ path leading to it is true in the current session.

1. **Identify your current logic setup.**  
Currently, the [criteria](https://forum.avicennaresearch.com/t/criteria/1236) for **Q3** might look like this:

2. **Update dependent question criteria to include the full condition chain.**  
You need to explicitly tell Avicenna that Q3 should only appear if Q1 was _also_ answered in a specific way _today_.

3. **Make the “Root” question Mandatory.**  
Ensure that **Q1** (the first [question](https://forum.avicennaresearch.com/t/questions/1291) in the chain) is set to **[Mandatory](https://forum.avicennaresearch.com/t/questions/1291#p-2918-common-question-attributes-1)** and is always visible to the participant.  
This is essential because Avicenna needs a guaranteed fresh response in the current session to start the logic chain.

4. **Apply the same pattern to deeper dependencies.**  
If you have a **Q4** that depends on Q3, you must chain all previous conditions:

5. **Preview and test your flow.**

## Pro Tip

If you have many questions dependent on one specific answer (e.g., 10 questions that should only show if `Q1 == Yes`), you do not need to add the chain to every single question.

Instead, move all those dependent questions into a **[Section](https://forum.avicennaresearch.com/t/flow-control/1285)**, and apply the criteria `Q1 == 1` to the **Section** itself. This makes managing your survey flow much cleaner and easier.
