Trouble creating an item with "category" and "app" fields
AnsweredTrying to create a new Student Item using the following code:
$grade = settype($_POST['grade'],'integer'); // I did this because I got an error that said "Invalid value u'4': Must be Integral'."
** $teacher = settype($_POST['teacher'],'integer');**
** try { **
$new_student = $this->api->item->create(STUDENT_APP_ID, **
* array('fields' => *
** array(
"title" => $_POST['first']." ".$_POST['last'],
"first-name" => $_POST['first'],
"last-name" => $_POST['last'],
"teacher" => $teacher,
"grade" => $grade
)
)
);
** }**
Now I that I added the SETTYPE I get an error about it being boolean even though the console displays a number for both of them. Here's the output:
error: "There was an error. The API responded with the error type 'invalid_value' and the message 'Invalid field 17766538 ('value'): Invalid value True: Must not be bool'."
grade: 3
message: "There was a problem adding the student to the account, please contact a site admin"
success: false
teacher: 19244880
So now I have "integer" values for both fields and they consider them boolean and I still can't create this item :(
Please sign in to leave a comment.
Comments
3 comments