-
Notifications
You must be signed in to change notification settings - Fork 4
Using Selectors and sql options
Aditya Chinchure edited this page Aug 29, 2020
·
4 revisions
A selector defines criteria on which data is selected (from any data source) and is a part of the LEAP API.
You can find examples of these being used: API Examples
There are three main types of selectors:
selector = "[field1] = 1 and [field2] < 1960"
selector = {
"type": "default",
"useLocalData": True,
"filter": "[field1] = 1 and [field2] < 1960",
"fields": ["field3", "field4"] or "field5"
}
The useLocalData
option will allow Site Algo to save a copy of the obtained data in the first iteration so that in can be used in future iterations without re-loading the dataset from REDCap (or CSV).
selector = {
"type": "sql",
"useLocalData": True,
"sql_func": "count",
"sql_options": {...}
}
Here, sql_options
can contain any object that the SQL generator function will require. Since sql_options can be complex, you can run Selector Verification first.
- Home
- Setup LEAP for development
- Configure LEAP
- API Usage
- Connecting to REDCap