Skip to content
Minha Lee edited this page Oct 23, 2024 · 3 revisions

CommCare Session External Instance Definition

The CommCare Session External Instance defines an artificial instance interface to access data regarding a current CommCare 'session' (the process of selecting information that a form is filled out for). The Session values are selected by user input in the order specified in the CommCare Configuration files.

CommCare Session Instance Structure

The CommCare session contains two blocks of data, one which is statically structured and contains details which don't change depending on the entry being performed, and one which contains the details of the current entry action.

<session>
    <context>
        <deviceid/>             <!-- The unique ID for the entering device -->
        <username/>             <!-- The username of the user entering data -->
        <userid/>               <!-- The GUID of the user entering data -->
        <appversion/>           <!-- The identifier for the software application version performing form entry -->
        <window_width/>         <!-- The value in pixels of device screen width. To be used in menu/form display conditions --> 
        <applanguage/>          <!-- The current language slug set on the screen ('en', 'es', etc.) -->
    </context>
    <data>
        <*/>                    <!-- Dynamic data specified by a <datum> declaration in a suite <entry> -->
    </data>
    <user>
        <data>                  <!-- Custom user data associated with the logged in user -->
            <*/>
        </data>
    </user>
</session>

CommCare Session URI's

jr://instance/session

The only connection relevant for a session. No parameters are accepted.