Welcome, Guest
Username: Password: Remember me

TOPIC: RemoteControl add_participants problem

RemoteControl add_participants problem 1 year 1 month ago #100415

  • jday
  • jday's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Hello,

I'm having a problem using the RemoteControl2 function add_participants. Specifically, there seems to be a problem with passing the participant data parameter.

From what I gather from the manual and from the source of survey/application/controllers/admin/remotecontrol.php, this function expects the parameter to be a json-encoded array with keys that need to match the column names for this survey's specific token table. The manual shows a participant being added with just an email address, first name, and last name, so I'm attempting to add with this info. Like this: {"email":"me@example.com","lastname":"Bond","firstname":"James"}

The problem is that the function just returns the participant data parameter, no error, and does not insert a record into the table. Interestingly enough, if I call the function with badly formatted participant data, it will insert a record into the table with just a token and the table defaults.

Has anyone else run into this? Is anyone able to successfully use this function?

Thanks for your time!
The administrator has disabled public write access.

RemoteControl add_participants problem 1 year 1 month ago #100423

  • jday
  • jday's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Ok, it turns out that I was just using this incorrectly.

instead of passing add_participants an array of user info, I wanted to pass it an array of arrays of user info.

So instead of:
$participantdata = array(
'email' => $email,
'lastname' => $last_name,
'firstname' => $first_name
);

I should have done something like:
$participantdata[] = array(
'email' => $email,
'lastname' => $last_name,
'firstname' => $first_name
);


My mistake, but I hope this helps anyone else having the same problem.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.098 seconds
Donation Image