While Avicenna’s triggering logics cover most use cases, you may want to prompt surveys on personalized schedules that require a more flexible approach. For complete flexibility, we offer the following options:
- Release an activity to instantly deliver it to participants (for example, when immediate action is required).
- Schedule individual sessions through the calendar interface.
- Upload a CSV file to schedule sessions for multiple participants and activities within your study, all in a single upload.
In this article, we’ll focus on the third approach.
The Situation
Your participant pool includes individuals scheduled for surgery on different dates. You want to prompt each participant with a daily survey at 9:00 AM for the 10 days immediately following their specific surgery date.
What to Do?
To set up this personalized schedule, you will first prepare the necessary surveys in Avicenna and then generate the CSV file for upload. Before you begin, please review the important rules below to ensure your upload is successful.
[!note] Important CSV Upload Rules:
- The file must be under 1MB and have no more than 10,000 rows.
- Sessions can only be created for active participants.
- Each
scheduled_timemust be at least one hour in the future and fall within the participant’s specific participation period.
Here are the steps in detail:
-
Create your daily survey. Do not add any triggering logic to it, and delete the existing default triggering logics. Save and publish the survey. Ignore the warnings.
[!note]
If you want to link a notification template to your survey, you need at least one triggering logic; otherwise, the system won’t let you publish the survey. As a workaround, you can add a dummy Time triggering logic and set its criteria to1 != 1, which will always be evaluated toFalse, prompting no sessions. -
Create a baseline survey to capture the surgery date for each participant. The survey should contain one calendar question with its
Selectorset toDate. You can also add other questions to this survey if needed. -
Create and link a notification template to the baseline survey to get notified whenever a participant submits the baseline survey. This is essential to ensure the timely scheduling of sessions.
-
To generate CSV files for upload, you can use tools like R, Python, Excel, or Google Sheets. For this example, we will use Google Sheets. Open your spreadsheet. Create two sheets. Let’s name the first one
CSVand the second oneParameters. -
Define three parameters in the second sheet:
Participant ID,Survey ID, andSurgery Date. You can set some values for them. -
Go to the first sheet and define three columns:
user_id,activity_id, andscheduled_time. The sheet should contain 10 rows, plus a header row. Use the Google Sheets formula and parameters to populate the first sheet:- For cells under the
user_idcolumn, use=Parameters!$B$1. - For cells under the
activity_idcolumn, use=Parameters!$B$2. - For the
scheduled_timecolumn, use this formula to generate a readable date and time string in the required YYYY-MM-DD HH:MM:SS format:=TEXT(DATE(YEAR(Parameters!$B$3), MONTH(Parameters!$B$3), DAY(Parameters!$B$3) + (ROW() - 1)) + TIME(9, 0, 0), "yyyy-mm-dd hh:mm:ss")
- For cells under the
-
Download the
CSVsheet: To do this, go to File > Download and choose Comma Separated Values (.csv). -
Upload the CSV file into Avicenna: On the Activity Sessions page, click Create New Sessions and select Create via CSV File.
-
Review the upload results: After the upload is processed, a summary dialog will appear. It will show you how many sessions were created successfully and list any that failed, along with the reason for the failure.
-
To see the generated sessions more easily, you can switch to the
Yearview mode.
Pro Tips
For simplicity, this guide does not consider participant time zones or daylight saving time. The date/time values will be in UTC when uploaded, and after the upload, you might notice a shift in the time (and probably date). You can define the participant’s timezone or the date range for daylight saving time as new parameters and adjust the formula for the scheduled_time column accordingly.
[!note]Good to Know:
- Sessions created this way are known as “researcher-defined” sessions.
- A successful upload automatically triggers a device reload for the participants you scheduled sessions for.
- If your study has the “Capture Reason for Changes” feature enabled, you will be prompted to enter a reason before the upload is finalized.









