Create a Type From an Endpoint

When you create a type from an endpoint, you define a custom type structure by using the endpoint's (response) data structure.

For example, when sending a request to a get_publicWorkers endpoint, you might want the structure of the response to be an array with the id and a few specific fields (say, a string name and email, among others). You can create a type by selecting the endpoint, then choosing the fields that you want in the response. All variables that are assigned this custom type will have the same data structure.

To create a type from an endpoint:

  1. Select your App UI, flow, or page artifact in the Navigator. You can also select a dynamic layout or a fragment.
  2. Click the Types tab to open the Types editor.
  3. Click + Type and select From Endpoint.
  4. Select an endpoint from the list. Click Next.

  5. Select the endpoint attributes you want to include in the data structure. Click Finish.

When your new type displays in the Types editor, you see it is an object type containing the endpoint fields you selected.
Description of var-type-fromendpoint-result-appui.png follows
Description of the illustration var-type-fromendpoint-result-appui.png

Use the options in the right-click menu to take further action (for example, to create a variable for this specific type or to add more fields from the endpoint).
Description of var-type-fromendpoint-righclickmenu-appui.png follows
Description of the illustration var-type-fromendpoint-righclickmenu-appui.png

When the type is associated with a variable, you can view its usage information under Usages in the Properties pane (for example, which variables are based on it and which pages use those variables). You can click a usage to readily navigate to that page.