Zum Inhalt springen
Funktionen Preise Doku Kontakt Anmelden Jetzt starten
Sprache

Working with CommonLynk as an agent

For an AI agent or a script building forms for a person: the addresses, the import routine, knowing a run has finished, the report, undoing an update, and what blocks publishing.

An agent acting for a signed in person uses the same pages the person uses, with that person's permissions; there is no separate interface. Every address below is on the workspace's own address and needs the person's session.

Addresses

AddressWhat it is
/forms/import/xlsform/Import a new form from a workbook. A preview runs first and saves nothing.
/forms/import/xlsform-update/?form=<form id>Update an existing form from a changed workbook. Questions are matched by name and keep their answers.
/forms/import/xlsform/runs/<run id>/status.jsonA run's state as JSON, read with GET only. An update run has the same address under the update's import page.
/forms/import/xlsform/report/<run id>/The run's report, row by row. Add report=errors or report=warnings to the query to filter it.
/forms/<form id>/build/The form's Design tab: its questions as they are now.
/forms/<form id>/check/The form check: every error that blocks publishing and every warning, each named on its question.
/forms/<form id>/preview/?start=<variable>The designer's preview: the form as a collector sees it, opened at the question named in start= (its variable name). It can fill every required answer with test values and saves nothing. The fill page does not read start=.
/forms/<form id>/The form's Overview, with its version history.
/forms/<form id>/versions/<version>/restore/Restore a published version as a draft: open it to read what changes, then confirm.
/llms-full.txtThis whole user guide as one text file, on the public website.

The routine

  1. Import: upload the workbook on the import page. A preview runs first and saves nothing.
  2. Preview: wait until the run has finished, as described below, then read the notices and the rows that need attention. Each names its row and what was lost.
  3. Commit: confirm the preview on the same page. The commit runs exactly the preview's file and options.
  4. Check: open the form check. Fix each error in the workbook and update the form with it, rather than editing by hand, so the workbook stays the source.
  5. Publish: when the check shows no error, publish from the form's header. Publishing is never automatic: an import or a restore always leaves a draft.

What blocks publishing

The publish gate refuses a form while any of these errors holds:

  • A setting left to decide later (what the form belongs to, where respondents come from, the respondent group or the form type) is still undecided.
  • The form asks no questions.
  • Two questions have the same name.
  • A question name is a word SPSS or Stata reserves.
  • A constraint or calculation names a question that does not exist.
  • A condition names a question that does not exist.
  • A question, note or section text shows ${name} for a question that does not exist.
  • A knowledge test has no correct answer on any question.
  • A label has no text in the form's design language or the workspace's primary language.
  • Respondents come from the activity chosen at each response, which can add new people, but no respondent group is chosen.
  • Respondents come from a list or a roster, but no respondent group is chosen.
  • The respondent source can produce nobody.
  • A dataset that pulldata() reads is not attached, or lacks a column it reads.
  • The form has preloaded answers but no respondent list, so no row can be matched to a respondent.
  • The public link is set to verify who fills it, but no verification question is chosen.
  • The public link is set to verify who fills it, but neither national ID nor phone is asked, so no person can be found.
  • The public link verifies people by their name without a national ID or phone, alone or beside the shared access code.
  • The public link verifies people by phone alone, but the person is not required to be on the respondent list.
  • The public link is set to verify who fills it, but the respondents are not individuals.
  • The public link is set to verify that the person is on the respondent list, but the form has no respondent list.
  • The form's responses will be used to register people, but a required field of the register is not asked by a required question that can appear (bound with cl::bind or Lynked).
  • A question that follows another one has choices that match none of its parent's choices, or a parent choice for which it offers nothing, so a required answer can become impossible.

The settings a new import most often leaves undecided can be set in the workbook's commonlynk sheet, so the form arrives ready:

  • form_type
  • subject
  • registers_people
  • off_list_policy

What the form belongs to and where its respondents come from are chosen in the form's Settings. Warnings never block: they are published once acknowledged.

Knowing a run has finished

A run has finished when its status.json says finished is true; succeeded then says whether it completed. The page shows the words for an outcome only once it is final, never before, so an agent reading the page cannot read an outcome early.

  • {"finished": true, "succeeded": true, "state": "completed", "report_url": "…"}

Read status.json every few seconds at most, and stop after a time limit of your own. A run whose worker stopped is reported as interrupted.

The report

status.json carries report_url. The report lists every row with its outcome and the issues found, and the import page's notices summarise them. Read the rows that need attention first.

Undoing an update

An update from a workbook changes questions in place, so the import's own Undo cannot reverse it. Restore the form's previous published version as a draft instead: the update run names that version and its address. Open the restore page, read what it would change, and confirm.

A restore keeps every answer: a question the version lacks is retired with its answers, and a question it has comes back with the answers it kept. It never publishes; publish again after the check.

Trust the screen

This guide and the text file are generated. The form check, the import preview and the report read the actual form. When they disagree with this guide, trust the screen, and tell the person you work for.

Two other topics complete this one: the XLSForm reference, and porting from ODK, KoboToolbox and SurveyCTO.

  • /docs/forms-and-data-collection/xlsform-reference/
  • /docs/forms-and-data-collection/porting-from-odk-kobo-and-surveycto/