-
Notifications
You must be signed in to change notification settings - Fork 2
REDCap
Kairsten Fay edited this page Oct 19, 2020
·
2 revisions
Within the REDCap project, go to Project Setup. Find and click the Additional Customizations button. Scroll to the bottom of the modal, and find the Data Entry Trigger section.
There is no official REDCap API for retrieving an event ID, but this event ID is required for generating deep links to specific instance of forms within REDCap.
To find the event ID, you can look at the event_id
param in the URL of a form from your target arm and event.
If there are no forms for the arm or event you're targeting, then with a little hacking, you can retrieve the event ID in the following way:
- From the home page of your target REDCap project, under Project Home and Design, click on Project Setup.
- Then, under Define your events and designate instruments for them, click
Define my events
. - In your browser console, run the following JavaScript snippet:
edit_links = document.querySelectorAll("a[onclick^=beginEdit]") parse_onclick = a => a.getAttribute("onclick") .match(/beginEdit\("(?<arm>\d+)","(?<event_id>\d+)"\)/) .groups; console.table( Array.from(edit_links).map(a => ({ name: a.parentElement.parentElement.querySelector(".evt_name").textContent, ...parse_onclick(a) })) )
The resulting table detials the event_id
for each event defined in the current tab's arm.
Click through the other tabs to see event_ids
for other project arms.