getFromFormAndFormSubmission static method
Will get a PcoCollection
of PcoPeopleFormField objects (expecting many)
using a path like this: /people/v2/forms/$formId/form_submissions/$formSubmissionId/form_fields
Getting a PcoCollection
is useful even when retrieving a single object
because it contains error data and helper functions.
Additional options may be specified by using the query
argument, but some
query options are also available as boolean flags in this function call too.
Implementation
static Future<PcoCollection<PcoPeopleFormField>> getFromFormAndFormSubmission(
String formId,
String formSubmissionId, {
String? id,
PcoPeopleFormFieldQuery? query,
bool getAll = false,
bool includeOptions = false,
}) async {
query ??= PcoPeopleFormFieldQuery();
if (getAll) query.getAll = true;
if (includeOptions) query.include.add('options');
var url =
'/people/v2/forms/$formId/form_submissions/$formSubmissionId/form_fields';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoPeopleFormField>(url,
query: query, apiVersion: kApiVersion);
}