# Customize the ODK Importer Configuration based on the ODK Form Fields

## Description

This document provides step-by-step instructions to customize the ODK Importer configuration based on the ODK form fields to cater to the needs of the stake holders.

**Note**

Every ODK form must have its own ODK importer.

## Prerequisites

* A user must have Administrator role to access ODK Central in OpenG2P systems.
* A user must know the pyjq syntax to customize the value in the JSON Formatter fields.

## Procedure

1. Login to ***OpenG2P*** systems

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FAdCrgvkpmpHKbnIoGkRP%2Fopeng2p_application.png?alt=media&#x26;token=e23ea31d-8859-4e33-b78e-a4f954563871" alt=""><figcaption><p>OpenG2P application</p></figcaption></figure>

2. In the menu bar, click the icon ![](https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2Fgit-blob-1b48611b7e3fc05b72b589735073c90404ac05ef%2Fimage.png?alt=media) and select ***ODK**.*

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FwBdSNv7DUsq0rPq6rCVO%2Fmenu-odk-importer.png?alt=media&#x26;token=76a99062-bfc0-42d9-b414-361eb6a3ddba" alt=""><figcaption><p>ODK </p></figcaption></figure>

***ODK configuration*** screen is displayed.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FxnKYX1gktugO2wcl6v1E%2FODK-configuration.png?alt=media&#x26;token=dbf78f10-3225-4832-aeb5-8a5c8277356b" alt=""><figcaption><p>ODK configuration</p></figcaption></figure>

3. Click the **Create** button.

***ODK Configuration/New*** screen is displayed.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2Fm3JnllHxSYLMvQq9a07L%2FODK-configuration-ODKnew.png?alt=media&#x26;token=b4e2d58f-063a-480d-9a74-7f408a816755" alt=""><figcaption><p>ODK Configuration/New</p></figcaption></figure>

4. Enter the valid values to access ODK Central in OpenG2P systems and customize the ODK Importer configuration based on the ODK Form Fields

| Field                                   | Description                                                                                                          |
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| Start                                   | Click the ***Start*** link to execute the schedule job to run periodically at fixed times, dates, or intervals.      |
| Restart                                 | Click the ***Restart*** link to re-execute the schedule job to run periodically at fixed times, dates, or intervals. |
| Stop                                    | Click the **Stop** link to stop the execution of the  schedule job.                                                  |
| ***ODK Central***                       |                                                                                                                      |
| Name                                    | Enter the name for the ODK importer.                                                                                 |
| Base URL                                | Enter the URL of the ODK Central.                                                                                    |
| Username                                | Enter the username which is used to login ODK Central                                                                |
| Password                                | Enter the password which is used to login ODK Central                                                                |
| ***Project details***                   |                                                                                                                      |
| \*[Project](#project)                   | <p>Enter the project number. </p><p>For example, 5</p>                                                               |
| \*\*[Form ID](#form-id)                 | <p>Enter the ID of the form.</p><p>For example, Household\_data\_collection </p>                                     |
| ***Target settings***                   |                                                                                                                      |
| Target Registry                         | <p>Select the appropriate option. The valid values are:</p><ul><li>Group</li><li>Individual</li></ul>                |
| \*\*\*[JSON Formatter](#json-formatter) | Use the pyjq library to manipulate JSON, based on the required fields in OpenG2P system.                             |
| ***Time interval***                     |                                                                                                                      |
| Interval in hours                       | Enter the time duration in hours to run the job automatically.                                                       |
| ***Program details***                   |                                                                                                                      |
| ODK Program ID                          | Enter the program ID                                                                                                 |
| Save                                    | Click the ***Save*** button to save the data                                                                         |
| Discard                                 | Click the ***Discard*** to clear the data                                                                            |

### Test Connection

***Test Connection*** feature establishes the connection between ***ODK Central*** and ***OpenG2P*** systems.

5. Click the ***Test Connection*** button.

If the ***Test Connection*** feature connects the ***ODK Central*** and ***OpenG2P*** systems successfully, a successful message pop ups.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FwNA87IFN4f3AlLRSSg7U%2Ftest-connection-successful.png?alt=media&#x26;token=bffb35f2-c977-44b3-a21b-c02c595c2173" alt=""><figcaption><p>Test Connection - Successful</p></figcaption></figure>

If the ***Test Connection*** feature unable to connect the ***ODK Central*** and ***OpenG2P*** systems, an error  message pop ups. Click the OK&#x20;

6. Click the ***OK*** button to exit the dialog box.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FBZZUK5TXwZE4i11xY7Wp%2Ftest-connection-failure.png?alt=media&#x26;token=409e8150-18b7-4f08-9fbb-1c26e1ac979c" alt=""><figcaption><p>Test Connection - Failure</p></figcaption></figure>

### Import Records

***Import Records*** feature imports and stores the records in Social Registry.

7. Click the ***Import Records*** button.

If the ODK form is imported successfully, a success message pops up.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2Fi1Rf9AMmfyXRkZp0VXCg%2Fimport-success.png?alt=media&#x26;token=218d5e67-78a6-4b16-8f5d-a7b66f6fdcd5" alt=""><figcaption><p>Import record - Success</p></figcaption></figure>

If there is no new ODK form submitted, then ODK form records will not be imported.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FGNjlxTEiT2ukXlYKGtro%2Fimport-record.png?alt=media&#x26;token=7a0f75d2-e8e1-42f3-9115-22480e09f8b8" alt=""><figcaption><p>Import record</p></figcaption></figure>

A view of the ODK form recorded in Social Registry.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FqcRhIG4YfbdoYysTSUrn%2FODK-form-recorded.png?alt=media&#x26;token=ad799cc8-0852-413f-91fd-6ec4ad3b9a35" alt=""><figcaption><p>ODK form recorded</p></figcaption></figure>

The below image shows the specific ODK form record.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2F71lbBVGp2QtYTCIoi6qg%2FODK-form-specific-record.png?alt=media&#x26;token=6aa1e5f5-7bcb-4f2b-a6af-3c6484ac6571" alt=""><figcaption><p>Specific ODK form</p></figcaption></figure>

The Household Data tab shows only the fields which are configured using pyjq JSON formatter in ODK importer. The fields are populated while the ODK form is imported to the Social Registry.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2F0PibECIxsdFVV8OBzJDY%2Fpopulated-field.png?alt=media&#x26;token=cb210499-44a3-484e-82df-06b19af2e9cd" alt=""><figcaption><p>Populated fields</p></figcaption></figure>

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FWHSYKi6asf1T1n5bjfgA%2Fpopulated-field%20(2).png?alt=media&#x26;token=4c7485f3-2a85-4804-bc81-afb6ce946ede" alt=""><figcaption><p>Populated fields</p></figcaption></figure>

You can find the created ODK form below the name column in ***ODK Configuration*** screen.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FxnKYX1gktugO2wcl6v1E%2FODK-configuration.png?alt=media&#x26;token=dbf78f10-3225-4832-aeb5-8a5c8277356b" alt=""><figcaption><p>ODK Configuration</p></figcaption></figure>

This completes process of importing a ODK form into Social registry by customizing the ODK Importer configuration based on the ODK Form Fields.

\---------------------------------------------------------------------------------------------------------------------

### Project

Follow the below steps to know the project ID taken from ODK Central.

1. Login to ***ODK Central***.

***ODK Central*** home page is displayed.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FK839DmeCXxkIB7F9D1Vq%2FODK-central-home-page.png?alt=media&#x26;token=d3996874-772c-4e20-b16f-a787ad65efa0" alt=""><figcaption></figcaption></figure>

Here, for example, click the Household data collection form below the program Test.

The Household data collection form's  overview screen is displayed.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FHd1QXHWr6P2FF4c6aDGq%2FODK-central-home-form-overview.png?alt=media&#x26;token=ddad840c-bc12-48e6-bdaf-9dbea4ee6542" alt=""><figcaption></figcaption></figure>

In the URL , the number which is after the project is the project Id (5) (highlighted in yellow).

### Form ID

Follow the below steps to know the form ID taken from ODK Central.

1. Login to ***ODK Central***.

***ODK Central*** home page is displayed.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FK839DmeCXxkIB7F9D1Vq%2FODK-central-home-page.png?alt=media&#x26;token=d3996874-772c-4e20-b16f-a787ad65efa0" alt=""><figcaption><p>ODK Central Home screen</p></figcaption></figure>

Here, for example, click the Household data collection form below the program Test.

The Household data collection form's overview form is displayed.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2FNskcYrYzQrVYV6zXwE98%2FODK-central-home-form-overview-form.png?alt=media&#x26;token=67296896-bc8e-476e-afa6-bc72eb6a195e" alt=""><figcaption></figcaption></figure>

In the URL , the word which is after the forms is the form Id (Household\_data\_collection) (highlighted in yellow).

### JSON Formatter

Configure the required fields based on the ODK form field using pyjq JSON formatter.&#x20;

For example, ODK importer configures the required fields from Household data collection form present in ODK central in JSON Formatter box.

<figure><img src="https://252389534-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCwMntokukpQZjoCcqMwL%2Fuploads%2F5Z3DTZmMAEGQjsuv3fnF%2FJSON-formatter-1.png?alt=media&#x26;token=a978f2a6-2ecd-49a7-8fc9-732dbba0fafb" alt=""><figcaption><p>JSON Formatter</p></figcaption></figure>
