Introduction

Getting started

Walkthrough Guides

CafeX Apps

Workflows

Using CafeX Collaborate App

Reporting

Managing CafeX

Integrating CafeX

Security

CafeX Apps

Using data in your App

Modified on Thu, 21 Sep, 2023 at 6:18 AM

TABLE OF CONTENTS


Data Sets are the way that an App interface interacts with data. For an App Builder, Data Sets provide you with a consistent way of interacting with different types of data. When you build your interface in the App Studio, you wire interface Components to Data Sets without having to know whether it is a local Data Table, or an external web API behind it, for example. You simply have to reference the Data Set you wish to use. You configure a Data Set with what it needs to retrieve data from, or write data to, a specific source. 


Before you can add a Data Set to your App, you need to configure the underlying data source.  The data source specifies the schema that acts as the input and output of the Data Set.  For example, if you use an External API, the data source has the URL endpoint, the request types, and URL parameters so that the CafeX platform can invoke the external API.


The following shows the different types of Data Sets:

 

External API

Use External APIs to integrate data and functionality from external systems using HTTP.

Data Table

Data Tables store private data in a Workspace using a predefined schema.  For information about creating a Data Table.
See: Creating a Data Table.

Rulesets

Rulesets present business decisions to your App. For example, you can use them to provide a warning or tooltip to a user based on inputs meeting a chosen criteria.
See: Creating a Ruleset.

JavaScriptUse JavaScript rulesets to perform advanced operations using input Data Sets to construct a new output Data Set.
See: Using a JavaScript Data Set.

Variables

You use Variables to hold a value or an expression and they are often used with Event Handlers to manage the visibility of the App Studio Components, or to present data in Components.

See: 

Workflows

Workflows typically bring data into a component or execute actions across different applications. See: Integrating a Workflow in CafeX App Studio


Data Sets have a set of inputs that they pass to the underlying data source. The App interface provides the Data Set with values for these inputs. They can be outputs from other Data Sets or values of fields from the interface.


In the following example an App provides an interface field and a Variable to the Data Set definition.

The Data set expresses an External Data Source to a remote API. As the App Builder you associate the Component fields and Data Set values as input fields of the Data Set.  When the App evaluates the Data Set, it passes the parameters to the External Data Source.  In this example it maps interface fields onto API parameters.

Evaluating Data Sets

As an App Builder, you can control when a Data Set evaluates.

CafeX evaluates a Data Set when all of the required inputs have values and subsequently when any input value changes.  

Your App interface, waits for the input values of a Data Set before it can evaluate it.

You use the Required option to tell your App not evaluate the Data Set unless that parameter has a value.

CafeX evaluates Data Sets if the following criteria are met:

  • The Data Set has no parameters—It can evaluate immediately.
  • None of the Data Set parameters have assignments—The interface is not waiting for an input.
  • Only when all required parameters have values—The interface is not waiting for an input.


In the following example, an App evaluates a Data Set and the result, or the output, is available on the original Data Set.

App Components, other Data Sets, and mustache commands can use the Data Set output.


Adding a Data Set to an App


To add a Data Set: 

  1. Explorer > App.
  2. On the right side of the page, click Configuration.
  3. Click Add Data Set.
  4. Data Sets require additional configuration.

In this section, you add a new Data Set to retrieve the data from your Data Table.


For an example walkthrough, of data source configuration, Data Set addition, and Component use, see: Enhancing your App—retrieving and presenting data

 

Chaining Data Set evaluation


It is possible for you to take the outputs of one Data Set and use them as the input for another Data Set evaluation without the need to write any code to handle the parameters. 


When an input of a Data Set changes, this causes the Data Set to reevaluate. So it is possible for you to chain data set evaluation together. This may be necessary in Apps that use APIs that do not return all of the necessary information on a single request. It is also useful when your App user's actions typically result in a second request that takes a long time to load,  The result of the first Data Set automatically causes the second Data Set to reevaluate.  In another example, you may use Rule Sets to validate an input and present an App User with indicators or instructions to follow.

 

Chaining Data Set evaluation means you are automatically using the output from one Data Set to trigger another Data Set to evaluate. This is an important feature of the App Studio because you can cause several Data Sets to evaluate in parallel, or sequentially, without user interaction, to dynamically update what is happening on the screen. 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article