Skip to content

TrueContext

TrueContext is a mobile forms and field workflow platform. Protocol Launcher allows you to generate its official App-to-App URLs.

Usage

There are two ways to use this library:

  • On-Demand import from subpaths enables tree-shaking and keeps bundles small.
  • Full Import from the root package is convenient but includes all app modules.

Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.

Select Installation Method

On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.

Notes

TrueContext documents the truecontext://x-callback-url/action format, the alternative tcxt:// scheme, continued support for prontoforms://, and the HTTPS alternative https://prontofor.ms/x-callback-url/action. This module exposes only the documented App-to-App actions: launch, refresh, list, open, send, and search.

Use the answers object for dispatch values. Its keys are TrueContext question unique IDs, so Protocol Launcher URL-encodes both the key and the value. Following TrueContext's URL Encoding page, spaces and special characters are percent-encoded, while parentheses are left unencoded. The documented x-callback parameters are available as xSuccess, xCancel, and xError.

URL Methods

Launch

Generate the documented launch action.

On-Demand
ts
import { launch } from 'protocol-launcher/truecontext'

const url = launch()

Refresh

Generate the documented refresh action, which launches the app and downloads new form versions, data sources, and dispatches.

On-Demand
ts
import { refresh } from 'protocol-launcher/truecontext'

const url = refresh()

List

Display a specific app area, or list forms and resources by tag.

On-Demand
ts
import { list } from 'protocol-launcher/truecontext'

const url = list({
  type: 'inbox',
})

Open

Open a form, record, or resource. The answers object dispatches values into form questions by unique ID.

On-Demand
ts
import { open } from 'protocol-launcher/truecontext'

const url = open({
  name: 'Universal Work Order',
  answers: {
    'Job - Type': 'Warranty',
    'Job - Work Order #': 1234567,
  },
  xSuccess: 'pftest://success',
  xCancel: 'pftest://cancel',
  xError: 'pftest://error',
})

Send

Open, populate, and send a form. TrueContext documents type and at least one form identifier as required for this action.

On-Demand
ts
import { send } from 'protocol-launcher/truecontext'

const url = send({
  type: 'forms',
  formID: 99999999,
  answers: {
    ServiceType: 'Warranty',
  },
})

Open the TrueContext Mobile App Search list with documented text, state, or date filters.

On-Demand
ts
import { search } from 'protocol-launcher/truecontext'

const url = search({
  stateFilter: 'AllIncomplete',
  dateSearchType: 'DatePeriod',
  datePeriod: 'ThisWeek',
})

Generated URLs

ts
launch()
// => 'truecontext://x-callback-url/launch'

refresh()
// => 'truecontext://x-callback-url/refresh'

list({ type: 'inbox' })
// => 'truecontext://x-callback-url/list?type=inbox'

open({
  name: 'Universal Work Order',
  answers: { 'Job - Type': 'Warranty', 'Job - Work Order #': 1234567 },
})
// => 'truecontext://x-callback-url/open?name=Universal%20Work%20Order&Job%20-%20Type=Warranty&Job%20-%20Work%20Order%20%23=1234567'

send({ type: 'forms', formID: 99999999, answers: { ServiceType: 'Warranty' } })
// => 'truecontext://x-callback-url/send?type=forms&formID=99999999&ServiceType=Warranty'

search({ stateFilter: 'AllIncomplete', dateSearchType: 'DatePeriod', datePeriod: 'ThisWeek' })
// => 'truecontext://x-callback-url/search?stateFilter=AllIncomplete&dateSearchType=DatePeriod&datePeriod=ThisWeek'

launch({ scheme: 'tcxt' })
// => 'tcxt://x-callback-url/launch'

open({ format: 'web', name: 'asset list' })
// => 'https://prontofor.ms/x-callback-url/open?name=asset%20list'

Official Documentation