get_asgmts_list: Get the assignments on the server

Description Usage Arguments Value Examples

View source: R/get_asgmts_list.R

Description

get_asgmts_list gets information about the assignments for a certain version of a questionnaire. The user can find the questionnaire of interest using the template ID for the questionnaire or the name of the questionnaire. The user can also filter the list based on archived status and the interviewer/supervisor currently responsible for the assignment.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
get_asgmts_list(
  template_id = NULL,
  qx_name = NULL,
  version = NULL,
  responsible = "",
  archived = FALSE,
  output = "df",
  output_path = NULL,
  server = NULL,
  user = NULL,
  password = NULL
)

Arguments

template_id

Template ID for the questionnaire. This can either have dashes or not.

qx_name

Name of the questionnaire. It may be more convenient to specify the questinnaire name instead of the template ID. Do not specify both the template_id and qx_name.

version

Version of questionnaire.

responsible

Option to filter by the user responsible for the assignment. By default, it will find all assignments for the questionnaire regardless of who is responsible.

archived

Option to search for archived assignments. If TRUE, the assignment list will only show archived assignments. By default, the list will only show active assignments.

output

Desired output type for the list of assignments. Options are: "df" for data frame, "tab" for tab delimited file or "excel" for an Excel file. By default, it is a data frame.

output_path

Name of the file that you would like to save the output as. This must be specified if the output type is tab or excel. It is recommended to use forward slash (/) instead of backslash (\).

server

Prefix for the survey server. It is whatever comes before mysurvey.solutions: [prefix].mysurvey.solutions.

user

Username for the API user on the server.

password

Password for the API user on the server.

Value

A data frame or an exported file with information about assignments on the server.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
## Using template ID
all_assignments <- get_asgmts_list(template_id = "68b8a85fd7a84c45b4bb0c2c1c19c53f",
version=3, server = "lfs2018",
user = "APIuser2018", password = "SafePassword123")

## Using questionnaire name
all_assign_use_qx <- get_asgmts_list(qx_name = "Labour Force Survey 2018 Q1",
 version=3, server = "lfs2018", user = "APIuser2018", password = "SafePassword123")

## Filter by user responsible
super1_assignments <- get_asgmts_list(qx_name = "Labour Force Survey 2018 Q1",
 version=3, responsible="Supervisor1",
 server = "lfs2018", user = "APIuser2018", password = "SafePassword123")

## Export to Excel
get_asgmts_list(qx_name = "Labour Force Survey 2018 Q1", version=3,
output = "excel",
output_path="/User/bar/Documents/active_assignments.xlsx",
server = "lfs2018", user = "APIuser2018",
password = "SafePassword123")

## End(Not run)

l2nguyen/susoapir documentation built on Jan. 14, 2020, 2:29 p.m.