GetList
CDBResult CFormField::GetList( int form_id, string get_only_fields, string &by = "s_sort", string &order = "asc", array filter = array(), bool &is_filtered )
The method GetList returns a list of questions or fields of a web form as a CDBResult instance.
Parameters
Parameter | Description |
---|---|
form_id | The web form ID. |
get_only_fields | The following values are possible: |
by | Reference to the variable containing the field used to sort the result. The following values are possible:
|
оrder | Reference to the variable containing the sort order. The following
values are possible:
|
filter | An array used to filter values. The following keys are possible:
|
is_filtered | Reference to the variable containing true if the returned list is filtered, or false if the returned list is not filtered. |
Example
<? $FORM_ID = 4; // The ID of the web form // form the filter array $arFilter = Array( // question ID=140 or ID=141 "ID" => "140 | 141", // we need the ID to match exactly "ID_EXACT_MATCH" => "Y", // symbolic identifier "SID" => "VS_BIRTHDAY", // match symbolic identifier exactly "SID_EXACT_MATCH" => "Y", // text of the question "TITLE" => "Birthday", // entry in text of the question is sufficient "TITLE_EXACT_MATCH" => "N", // active state flag "ACTIVE" => "Y", // we need questions which are in the HTML table of results "IN_RESULTS_TABLE" => "Y", // we need questions which are in the Excel table of results "IN_EXCEL_TABLE" => "N", // we need questions which are in the filter "IN_FILTER" => "Y", // questions requiring an answer "REQUIRED" => "Y", ); // obtain the list of all questions of the web form #4 $rsQuestions = CFormField::GetList( $FORM_ID, "N", $by="s_id", $order="desc", $arFilter, $is_filtered ); while ($arQuestion = $rsQuestions->Fetch()) { echo "<pre>"; print_r($arQuestion); echo "</pre>"; } ?>
© «Bitrix24», 2001-2024