Set Skedulo Plus extension context and metadata

Configure the context and metadata for a Skedulo Plus extension to display the extension on the job details screen or as a global form for all resource users in your team.

Overview

In Get started with Skedulo Plus extensions, we downloaded the Skedulo Plus examples repository.

This repository includes a number of templates you can use to learn the Skedulo mobile extensions framework. The example extensions include a metadata.json file that contains the context for the extension.

The contextObject property can be set to either Jobs or Resources. Extensions with the Jobs context will be displayed on the job details screen, while extensions with the Resources context will be displayed as a global form for all resource users in your team under the More menu in the Skedulo Plus app.

In this article, we will show how to change the context for your extension by changing the context of the HelloWorld extension from Resources to Jobs.

Set the extension context

The HelloWorld extension is a simple extension that displays a form with example text. By default, the extension is set to the Resources context.

As it is currently set to Resources, the form will appear in the Skedulo Plus app under the More menu for all resource users in your team.

The Hello World extension in the Skedulo Plus app

Use the following procedure to change the context of the extension:

  1. Open the SkeduloPlusExamples/HelloWorld/mex_definition/metadata.json file in your preferred IDE or text editor.
  2. The contextObject property can be eitherJobs or Resources. For the purpose of this exercise, change the contextObject property to Jobs.
{
  "email":"swheeler@skedulo.com",
  "summary":"An example Skedulo Plus extension",
  "references":{},
  "templateId":"",
  "displayOrder":0,
  "contextObject":"Jobs",
  "revisionCount":1,
  "hasAttachments":[]
}
  1. Update the displayOrder property to set the order in which the extension will appear in the Skedulo Plus app. The lower the number, the higher the extension will appear in the list.

    For example, to set the extension context to Jobs, with the form appearing first in the list of extensions on the job details screen in the app, update the metadata.json file as follows:

{
  "email":"swheeler@skedulo.com",
  "summary":"An example Skedulo Plus extension",
  "references":{},
  "templateId":"",
  "displayOrder":1,
  "contextObject":"Jobs",
  "revisionCount":1,
  "hasAttachments":[]
}
  1. (Optional) Change the summary and email properties.

  2. Save the metadata.json file.

  3. Upload the extension to the Skedulo Plus mobile app using the Skedulo CLI. For more information, see Upload your Skedulo Plus extension.

    When installed, the form will appear in the Skedulo Plus app on the job details screen.

The Hello World extension in the Skedulo Plus app with the context set to Jobs