Free Support Forum - groupdocs.com

How to populate checkbox through api?

I am creating a document through the api. How do I populate a checkbox when using the api? More specifically what value can I put in a datasource to populate a checkbox field?


Also, how do you name a document when or after you are doing a merge? I am using the php sdk ->

$job = $mergApi->MergeDatasource($clientId, $fileGuId, $addDataSource->result->datasource_id, “pdf”, null);

I see these documents under the My Assemblies folder but I cant figure out how to name them.

Hi,


Thank you for the question. Please investigate our live demo sample and its source code for how to.

Best regards.

That demo was not helpful at all. I know how to add a value to field in a document using the merge api and a datasource. I can set the value for text fields just fine. I can not set the value for a checkbox in my datasource. What value do I give a checkbox in my datasource to make it merge as a checkbox that is checked in my document?

Hello,

Thank you for coming back.

If you need to fill the checkbox field , then you should use boolean value (true or false) for it . For example:

$field->name = $fields->result->fields[$i]->name;
$field->type = "boolean";
$field->values = true;

Please investigate our 35 demo example , it will show how to correctly fill all types of the fields.

If you will have more questions please feel free to contact us.

----------

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+