TABLE
TABLE OF CONTENTS
- Leveraging Data Sets
- Integrating external applications
- Enhancing the capabilities to your App
- Styling the Provider Enrollment App
Leveraging Data Sets
Understanding when to use Data Sets
In Building your first App you made a basic App to become familiar with the CafeX process and environment. Now with that understanding, you can create an App that makes use of Data Sets and external web APIs.
To learn how to use Data Sets we’re going to use the example from the US medical system which is responsible for controlling, tracking and monitoring medical service providers (like pharmacists, doctors and hospitals). Each of these providers must be enrolled into the system to provide service. Provider enrollment is a very complex operation that includes multiple processes, sometimes over a long duration. Provider enrollment is the process where healthcare providers apply to be enrolled in a health insurance network. Provider enrollment peaks at certain times of the year, when new professionals complete their academic training for example.
For the purposes of this article, you are going to create an App that an agent can use to process a provider’s emails, then check the provider’s current status and submit new enrollment information to the health insurance network, all from a single screen. This use case has been greatly simplified to highlight the conceptual operations within the App Studio.
The intent of this App is to speed up the handle time and the response accuracy by automating retrieval and cross checking of data from a single interface without the need to swap between applications.
Importing a prepared App
For this section some resources have already been prepared for you to make use of. You can import an App definition file to save time sharing the configurations for your App. Later the article covers what you export from an App. For this section you import definitions to access external web API endpoints.
You will need to download both training resources appstudiotrainingv3.zip and base64attachment.txt to help perform these following walkthroughs.
Important: Do not unzip the appstudiotrainingv3.zip file.
To Import an App:
- On the CafeX home screen, click Create a new App.
- Click Import from a file.
- Import the appstudiotraining.zip file.
- Click Open.
- Add a new App with the following parameters:
Name
Provider Enrollment - [INSERT NAME]
- Click Add.
- CafeX takes you to your newly created App.
- Under Workspaces, Click Create a Workspace
- Create a Workspace with the following parameters:
Name
Provider Enrollment
- Click Create Now.
Important: Going forward, the articles refers to this workspace as: your Provider Enrollment Workspace. At times, the article directs you to return to this workspace.
This time, you create a Workspace to provide context for your Provider Enrollment App before you begin to build the Custom View for your App. Any changes that you make to your Views or App configurations automatically apply to the Workspaces that exist. So modifications to your Custom View, even the one you have not made yet, apply to this Workspace.
Preparing a Custom View for the sample App
In order to configure our interface, using App Studio, you have to create a Custom View, like you did previously. For more information, see: Creating a Custom View.
To create a Custom View:
- From the App Overview Screen, go to Configure > Views.
- Click Add new View.
- Add a new View with the following parameters:
View name
Provider Enrollment Email App
View type
Custom
- Go to Configure > App Studio.
- Click Page 1.
- On the Appearance and Configuration panel, rename the page to Inbox.
- Go to Explorer > App.
Configuring and updating Data Tables
In this section we will show you how to define a table schema for a table in your Workspace that you can use to temporarily store enrollment emails in. Each row of the table represents an email that someone can process. A CafeX Data Table is a set of records, associated with your Workspace, where you can store private data. In this case, the CafeX Data Table is one that you configure to mimic an email inbox. The fields of tables can store complex data objects. For example, fields can reference Users, CafeX Workspaces, and files.
In all likelihood, the inbox would be retrieved using a workflow that is integrated with a dedicated mailbox or with a workforce management system that is already setup to retrieve such emails. For the purposes of this article, you will use a simple schema to act as the email inbox, so that you do not have to become familiar with the Workflow engine at this point. Each row of the table represents an email and each Workspace has its own inbox.
To configure a Data Table schema:
- From App Studio, use the navigation bar to click Data Tables.
- Click Add new table.
- Create a Data Table with the following parameters:
Table Name
Inbox
- Click on Inbox. The row expands.
- Click Add new field. You have to repeat this process for each field to add.
- Add the following fields:
Field name
Field type
Body
Short text
Subject
Short text
From
Short text
Attachment
Short text
Date
Date
For example:
At this point you have made a table schema, and each Workspace that you create has its own tables with this identical schema.
Configuring a View for a Data Table
In order to add data to your Inbox Data Table, you need to create a Grid View, to interact with the Data Tables of a Workspace. For more information about Views, see: Using the App Overview.
In this section, you add mock emails to the Inbox Data Table, in the instance of the table in your Provider Enrollment Workspace. Each Workspace has its own single instance of the table, so you have to modify the new table in this Workspace.
Currently, there are no rows in your table. For the purposes of this article, you add mock data to simulate two emails.
To create a Grid View:
- From the App overview, go to Configure > Views.
- Click Add new View.
- Add a new View with the following parameters:
View Name
Inbox
View Type
Grid
Data source
Inbox
To Add a rows to a table:
- Go to your Provider EnrollmentWorkspace.
- Click the name of your App in the menu bar of your Workspace.
- If you see your Custom view, select Inbox to open the Grid View.
- Click Add a record.
- Enter Data for each field. For example:
Field name
Data
Body
Hi, Can you please check the status of the following provider’s enrollment? NPI is 123456789
Subject
Provider Enrollment
From
Attachment
Copy and paste text from base64attachment.txt
Date
06/08/2023
- Click Add a record.
- Repeat steps 4 – 6 to enter details for a second mock email, change the fields as you like.
At this point, you now have some preparatory emails that your provider enrollment App can make use of. Although this process is artificial, you gain an understanding of one way that a Workspace can hold data objects relevant to the session that your App uses. In this example, you only use a single table, in more advanced Apps you can create several tables that cross-reference each other.
Retrieving and presenting data
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. 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. |
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. |
Variables | You use Variables to hold a value and they are often used with Event Handlers to manage the visibility of the App Studio Components. |
Workflows | Workflows typically bring data into a component or execute actions across different applications. |
See also: Using data in your App
In this section, you add a new Data Set to retrieve the data from your Data Table.
To add a Data Set:
- In App Studio, go to Explorer > App.
- On the right side of the page, click Configuration.
- Click Add Data Set.
- Add a Data set with the following parameters, the data source for this Data Set is the Data Table you created in earlier steps.
Name
emailsDataSet
Type
Data Table
Data Source
Inbox
- Click Add.
In your interface, you use Table Components to display data as rows and columns and typically use them when you have to display more than one record, or portions of records, at the same time. Table Components are useful when you need to perform searches, or compare records. For the purposes of this article, you use a Table Component to act as an inbox, it has to display information about the emails.
In this section, you add and configure a Table Component to replicate an email inbox, so that someone can review the emails coming into the queue.
To configure a Table Component:
- Click Components on the Explorer and Component Panel.
- Under Data, add the Table Component to your canvas.
- Click on the new Table Component.
- Rename the Component to inboxTable.
Important: As before, use consistent naming for your Components. While you build your App you start to reference Components, which saves you time and reduces errors. During the article, it is important to name the components exactly as written to help to debug any issues you encounter.
- Under configuration for your table, configure the following:
Read-only
ON (Toggle to Green)
Data Set
emailsDataSet
You set this table to read-only because, currently, you only want to display records and prevent App Users from editing data.
When you select your Data Set, you see there are other Data Sets to choose from. Those are system Data Sets that are available to you, that include information such as, the current user, the current workspace, and details about the tenant. You do not use these additional Data Sets in this article.
After you add the Data Set to your Table Component configuration, you see that the columns automatically appear from the schema of the Table Component. As an App Builder, you do not need to manually map data fields to interface fields, the App Studio does this for you, for all Data sets. If you want to hide any of the columns from the Interface, go to: Configuration > Fields and toggle the Visibility of the fields that you want to hide.
Important: In the App Studio, the data you see in tables and forms are not the data from your data sets. This is intentional, and provides you, as an App Builder, a way to verify functionality without having to execute any back-end data directly. The App Studio creates artificial values for Data set fields. This can be very important, if your App handles sensitive information, so that it does not appear when you design or build the interface. As an App Builder, you use the artificial data to be confident with the interface in your App, without having access to real data.
Displaying data fields in Components
In this article, you prepare Components to make the body of the email easier to read. The App Studio manages a lot of the interactions for you here. All you need to do is create a new Text Component and associate it with the correct Data Set. When a user clicks a row of the inbox Table Component to open an email, CafeX evaluates the row and the email body displays in the Text Component. If the user clicks another row, the changes propagate to the same Text Component.
To reference a Component:
- On the Explorer and Component Panel, click Components.
- Under Graphical, add a Text Component to your canvas.
- Click on the text Component.
- Rename the Component to emailBodyText.
- Click your new Text Component add the following:
{{inboxTable.0.Body}}
Important: When you add a Table Component, the CafeX App Studio automatically creates a Data Set for the interface for you to use that represents the current state of the Table. The Text Component references the table, not the inbox, To reference the Table Component, you use a mustache. Data Sets are like tables, this means the Data set can hold multiple records. When you reference the Table Component in this way, you reference the selected rows. So this means inboxTable, selected row 0, and then the Body of that row.
You now have a text Component that displays the body of the email when a user clicks a table row. Exit the App Studio and from the App Overview Screen go back to your Provider Enrollment workspace to interact with your interface.
To exit the App Studio and go back to the App Overview Screen, click:
Integrating external applications
At this point you should be familiar with CafeX App Studio, the necessity of a Workspace, and how Data Sets formalize the interactions with data. In this article, you make use of a web API that provides JSON in its response. Your CafeX App calls out to external systems so that your App can make use of other applications. In addition, because CafeX manages the external APIs for you, you do not have to write code to authenticate, maintain, and establish the connection.
Important: For the purposes of this article, you do not need to configure an External Data Source, as they have already been set up for you. You can use these steps for future development.
The web API that this training provides, is a very simple RESTful API that you can use to retrieve information about Providers. The intention is that your App User searches for Provider information so that they can complete the tasks that the email contains.
You use the following endpoints in the article:
Operation | URL |
GET | /providers/ URL Parameters: NPI |
Returns an array of provider locations that matches the NPI URL parameter. | |
GET | /providers/{MCD}/ |
Returns information about a specific provider location by MCD. | |
POST | /providers/{MCD}/enrollmentForm/ |
Accepts an enrollment form submission for an MCD. |
You do not have to configure the External Data Sources for this article. You are able to review the configuration that the Enrollment Provider App requires.
To review the External Data Source configuration:
- Go to Configure > External data sources.
- Select any of the External Data Sources.
- Click Edit data source ().
- Under Configuration, is a JSON definition for the endpoint that your App uses to access the API.
- Under Schema, there is a JSON definition of information your App uses.
When you configure an External Data Source, you can use Extract Schema to have CafeX call the endpoint and parse the data object.
Adding search functionality
In order to perform search, you have to collect parameters and use them to evaluate a Data Set for an External Data Source. This gives your users the ability to search for a provider and present relevant information back to your users. You configure a search form so that an agent can find providers. Form Components allow you to submit parameters on a Data Set. When values are set, or changes, CafeX evaluates the Data Set and provides the App with new records. In a similar way to the Table Component, Form Components use the Data Set definition to know which fields to present to users. As an App Builder, you can adjust which fields are visible, for example, to provide different search options for users.
To provide search functionality you need:
- Add a Data Set to search on.
- Add a Form Component to let users enter fields to search on.
- Set the DataSet to evaluate with those fields.
- Add a Table Component to display the result of the search.
To add a Data Set to search on:
- Go to Explorer > App.
- On the Appearance and Configuration panel, click Configuration.
- Click Add Data set.
- Add a Data set with the following parameters:
Name
searchProviders
Type
External API
Data Source
getProviders
Operation
GET
This prepared external data source returns an array of providers when you search using an NPI. You can ignore the Data Set parameters in these steps, they are not necessary here, and you configure these later on in the training.
- Click Add at the bottom.
To add a search form:
- First add a Text Component as a title for your Form:
- Under Graphical, select the Component to add to your canvas.
- Add the Text Component to your canvas.
- Rename the Component to searchFormTitle.
- Set the TEXT field, add: Provider Search.
- Add a Form Component to your View:
- Click Components on the Explorer and Component Panel.
- Under Data, Add the Form Component to your View.
- Click on the new Form Component.
- In the Configuration Panel, rename the Component to providerSearchForm.
- Under configuration for your table, configure the following:
Search Form
ON (Toggle to green)
Data set
searchProviders
Forms either present Data Set results (as read-only), or can set parameters that a Data Set uses to evaluate and submit that data to the Data Set. In this example, you want your App Users to input an NPI, or a Provider Name, and click Search. Search submits the values of the fields to the searchProviders Data Set and then CafeX evaluates it. In this case, the evaluation results in a search that calls out to the API with the parameters and it returns the array of providers.
To ensure the Data Set knows which fields to use, because it could evaluate from multiple locations, you have to configure your providerSearch Data Set to use the fields from the providerSearchForm.
To set Data Set parameters:
- Go to your searchProviders Data Set
- Set the NPI and Provider name parameters to:
NPI
providerSearchForm > NPI
- Toggle NPI to Required.
The parameters you configure here tell CafeX when to evaluate the Data Set. In this case, when the App User submits the form. The Required option tells CafeX not to evaluate the Data Set unless that parameter has a value.
When the interface is no longer waiting for the input values of a Data Set, CafeX can evaluate it. CafeX evaluates Data Sets with GET operations when 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.
Important: CafeX evaluates a Data Set when all of the required inputs have values and subsequently when any input value changes. If you do not configure any inputs as being required, then the Data Set evaluates when the page first loads.
Now, you have to configure a result table, so that you can display the results of the Data Set.
To add a results table:
- In App Studio, on the Explorer and Component Panel, Click Components.
- Under Data, add a Table Component to your canvas.
- Name your new Table Component: providerSearchResultsTable.
- Under Configuration for your table, set the following:
Read only
ON (Toggle to Green)
Data Set
searchProviders
Data Path
providers
For example:
Important: The data shown in the table in the App Studio is not the data from the endpoint. As you have already seen, App Studio provides artificial data for Data Sets so that, as an App Builder, you do not need to invoke endpoints to begin formalizing your design.
This is all you have to do to allow App Users to search an external endpoint. Although the API for this article is very simple, the process is the same for more complex data retrieval. By specifying a single Data Set, CafeX can construct the schema for your interface, so that it can add inputs and outputs to forms and tables automatically. In addition, CafeX manages when to invoke those endpoints and maps interface fields to API fields for you.
Go back to your Provider Enrollment Workspace to try out the search.
The API returns artificial data for the search. So you can search for any NPI and it returns 2 records.
Each search result has an MCD value that you can use to look up more information on the provider location.
Evaluating Data Sets automatically
In this section, you add a second external data source so that your App Users can retrieve more information about a provider. Typically, searches only return enough information for users to select the correct record, and then applications perform read operations to retrieve a full record. The API to search for Providers only returns the name of the Provider, clearly your users need more than this. Your App requires a second Data Set to retrieve the provider record.
You need to complete the following:
- Add a new Data Set that evaluates when a user clicks a row from the table of results.
- Add a Form to view the entire record.
To add the new Data Set:
- Go to Explorer > App.
- On the Appearance and Configuration panel, click Configuration.
- Click Add Data Set.
- Add a Data Set with the following parameters:
Name
additionalProviderInformation
Type
External API
Data Source
readProviders
Operation
GET
- Set the MCD Data Set input parameter to:
providerSearchResultsTable > mcd
This takes the MCD field output of the providerSearchResultsTable so that this Data Set evaluates. - Set MCD to Required.
To configure a read-only Form:
- On the Explorer and Component Panel, click Components.
- Under Data, add the Form Component to your canvas.
- Click on the new Form Component.
- Rename the Component to additionalProviderForm.
- Under Configurationfor your Form Component:
Read only
ON (Toggle to green)
Data Set
additionalProviderInformation
You now have an App with a search, and read record capability.
If you preview your App, you can see that the artificial Data sets evaluate as you expect:
If you go to your Provider Enrollment Workspace you can try it as an App User.
Chaining Data Set evaluation
You saw in the last section that 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. In this example, the second Data Set evaluates when you select a row from the result Table. However, it is possible to make CafeX evaluate a Data Set without user input. You can 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 also means you can write Apps that make queries and have results for users before they need it. For example, if you know that your users typically make a second request, and it takes a long time for that to load, you can set up your Data Sets to evaluate using the information from the first request.
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.
You now have a read only form that displays additional provider information based on the output of another Data Set. Go back to your Provider Enrollment workspace to interact with what you have created.
Applying business decisions using Rulesets
Rulesets are a way for business users to manage business rules that represent business decisions. Rulesets are another form of CafeX Data Set that apply conditional logic to inputs to produce a fact set. The CafeX Business Rules Engine does not require development cycles to update, so enables business users to manage the rules.
You configure the following to define a Ruleset:
- Input Facts (the inputs)
- Result Facts (the outputs)
- Conditional Rules
In this section, you add a Ruleset that takes the days remaining on a license and makes a business decision to alert the user if there are fewer than 5 days remaining.
To access Rulesets:
- Go to Configure > Rulesets.
- You already have a Ruleset to use in this part of the training.
- Open Days Remaining Alert
This Ruleset shows an error message when the days remaining on a provider's license is less than 5.
In the configuration for the Ruleset, you define the Facts and the Rules of your business rule.
After you configure the ruleset, you can use the Test Ruleset to check the results of inputs that you provide to check that it is working correctly.
Just like previously, your App uses a Data Set to evaluate the Ruleset.
To configure a Data set:
- Go to Explorer > App > Configuration.
- Click Add Data Set.
- Add a Data Set with the following parameters:
Name
daysRemainingDataSet
Type
Ruleset
Ruleset
Days Remaining Alert
daysRemaining
additionalProviderInformation > expiration (Required)
This Data set evaluates as soon as the days remaining the license value is available from the additionalProviderInformation Data Set, and returns a true The warning message displays if the value is less than 5. - Click Add.
You can now reference this Ruleset to display a warning to an agent when a provider’s license is about to expire.
Evaluating Ruleset Data Sets
In this section, you configure a Text Component to display a warning message if the Ruleset determines it is necessary.
- On the Inbox Page, add a Text Component to your canvas.
- Rename the Component to licenseWarningText.
- Add the following Mustache evaluation to your Text Component:
{{daysRemainingDataSet.0.errorMessage}}
The Text Component references the Data Set and displays the errorMessage that the Ruleset defines. In App Studio, you see no warning message; this is because the condition for the Ruleset has not been met.
Enhancing the capabilities to your App
Learning about App navigation
App Studio allows you to create additional pages for your interface. Multiple pages allows you smooth accessibility of all the functions and Components in your interface. For this part of the training, you add an additional page that acts as a page that the agent can submit a provider’s enrollment.
To add the submit function you need to complete the following steps:
- Add an additional page and navigation menu.
- Add the Data Set to enroll a Provider.
- Add a Form to submit the enrollment.
- Show a confirmation message.
To add an additional page:
- On the Explorer and Components panel Explorer > App.
- Right-click on the App to bring up a context menu:
- Click Add Page.
- Click Page 2 under App.
- In the configuration panel, rename the page to: ProviderEnrollment.
As an App Builder, you use the Navigation Component to display links to Pages of your App automatically. It manages the Pages of your App so that you do not have to create menu items to navigate. The App Users need to have two pages; one to read their email and perform a search, and a second to submit a form to manage the provider’s enrollment. It’s common for web applications to use a header that does not change between pages. So your App also needs a header where you can add the navigation component.
To add a Navigation Component:
- On the canvas, Click Add Header.
- Click Components on the Explorer and Component Panel.
- Under User Interaction, add the NAVIGATION Component to your App header.
- Click on the new Navigation Component.
The Navigation Component automatically keeps track of all the Pages in your App, or you can set them manually. - In the Configuration Panel, rename the Component to pageNavigation.
Writing records to a Data Set
In this section, you add another external Data Set so that your App Users can submit an enrollment form on behalf of the Provider. To do this, you add a Data Set that calls an external data source that uses the HTTP POST operation.
- Go to Explorer > App.
- Under the Appearance and Configuration panel, Click Configuration.
- Click Add Data Set.
- Add a Data set with the following parameters:
Name
enrollProvider
Type
External API
Data Source
postEnrollmentForm
Operation
POST
- Click Add.
In this section, you add and configure a form that allows the agent to enroll a provider on the enrollment page. You add a form to your page and use the postEnrollmentForm Data Set.
To configure an enrollment form:
- Click ProviderEnrollment Page.
- Click Components on the Explorer and Component Panel.
- Under Data, add the Form Component to your canvas.
- Rename the Component to enrollmentForm.
- Under configuration for your table, configure the following:
Data set
enrollProvider
The steps that you take are very similar to the steps you follow to add a Form to read records; however, this time you see that the Data Set fields are available for you to set. You can update the Fields if necessary. Before you can use the Form, you have to update the enrollProvider Data set to evaluate with the field values. This time, the evaluation submits a POST request to the endpoint instead of the GET used previously.
To submit the data to the API endpoint, you have to update the enrollProvider Data Set to point to the fields on the form.
Handling App User events
In this section, you add a Text Component under your enrollment Form, so that the App User can receive a notification after they submit an enrollment for a provider. You only want to show this message to someone after they submit the form. To do this, you create a Variable to store the visibility of the Component. You add a Variable Data Set to your App and use an Event Handler to set the visibility of the confirmation message.
To add the confirmation message:
- Click ProviderEnrollment Page, if necessary.
- Under Components > Graphical add a Text Component onto your enrollment page.
- Rename the Component to enrollmentNotificationText.
- Configure the following:
TEXT
Enrollment Form has been submitted
To add a visibility Variable Data Set:
- Go to App > Configuration.
- Click Add Data Set.
- Add a Data Set with the following parameters:
Name
showEnrollmentSubmitted
Type
Variable
Expression
false
You set the expression of the variable to false, so that you change the variable to true after the user submits a provider enrollment.
You now configure the Event Handler to trigger after the user submits an enrollment that changes the value of the Variable.
An event handler enables you to set an event type and assign an action to take; for example: After someone clicks a Button, set a variable. As an App Builder, you make use of Event Handler to perform operations that happen because of user interaction.
To add an Event Handler:
- Click ProviderEnrollment Page, if necessary.
- Click on your Form Component.
- Go to: Configuration > Event handlers.
- Click Add handler.
- Add an event handler with the following parameters:
Handler Name
enrollmentEventHandler
Event type
Form submitted
Action
Set a variable
Variable to Set
showEnrollmentSubmitted
Value to Set
true
Each Component has a Visible property. It controls when a component is visible on the interface. You use a Mustache to assign the value of a Variable to a Component’s Visible property.
In this section, you reference the showEnrollmentSubmitted Variable to hide a Text Component until the Variable evaluates as true.
To configure visibility:
- Click on enrollmentNotificationText Text component.
- On the Appearance and Configuration panel, click Appearance.
- For Visible enter the following:
{{showEnrollmentSubmitted}}
Now, the component becomes visible when the showEnrollmentSubmitted Variables is true. The Event Handler, enrollmentEventHandler, sets Variable as true after someone submits an enrollment form.
Handling Button Events
In this section, you add a button to display an email attachment. Often providers attach their license documents to their emails. Although you can make the attachment appear without requiring a button, this section serves to understand the Button Component and the corresponding event handling.
To do this you need to complete the following steps:
- Add a Variable Data Set to show or hide the attachment.
- Add an Image Component to display the attachment.
- Add a Button to click that updates the Variable.
To add a Variable:
- Under App > Configuration > Add Data Set. Add a new Data Set with the following parameters:
Name
openAttachment
Type
Variable
Expression
false
Buttons are an interactive element for your interface. In the App Studio, buttons trigger an event.
Add an image to your canvas to display the license attachment of an email. The attachment field of the Inbox Data Table contains an encoding of an image in base64. The CafeX Image Component also supports URLs and images that you upload; in this case you use a base64 data url as the format to display the image.
To configure an image:
- Click Inbox page
- On the Explorer and Component Panel, under Components > Graphical, add an Image Component to your canvas.
- Click on the new Image Component.
- Rename the Component to: attachmentImage.
- Configure the following:
DATA SET
inboxTable
DATA PATH
Attachment
To configure a Button:
- On the Explorer and Component Panel, under Components > User Interaction. Add a Button Component to your canvas.
- Rename the Component to: openAttachmentButton.
- Configure your new Button with the following:
TEXT
Open Attachment
You use Event Handlers to take an action when someone clicks a button. Initially, the visibility of the component is false. When the App User clicks the button, the event handler has to set the value to true, so that the interface detects the change, the image appears.
To add an event handler:
- Click on your button Component.
- Go to: Configuration > Event handlers.
- Click Add handler.
- Add an event handler with the following parameters:
Handler Name
attachmentEventHandler
Event type
Click
Action
Set a variable
Variable to Set
openAttachment
Value to Set
true
You have to use a Mustache to reference the openAttachment. Variable so that the interface shows the image when the variable evaluates as true. For more information, see: Using Variables.
To configure visibility:
- Click on the Image Component.
- Under Appearance > Visible, enter the following:
{{openAttachment}}
Now, after the App first loads, if the App User clicks an email they do not see the attachment until they click Open Attachment.
You can extend this exercise so App Users always see an attachment thumbnail and present the image in full-screen. On your own perform the following instructions:
- Add an Event Handler to the thumbnail to update the visibility Variable.
- Add a Container Component that includes:
- A full screen image.
- A close button that sets the visibility Variable back to false.
- Set the Container’s visibility to use the Variable.
Styling the Provider Enrollment App
The App Studio eliminates the need for you to understand CSS styling and front end development. You can adjust the appearance of every aspect of your App, such as Pages or Components using the App Studio.
In this section, you style the Components from earlier in the course. Typically, you style the interface for several reasons, including to create a great user experience and to apply familiar branding Apps.
To style the header:
- Click on Header.
- Under Appearance Panel, set the Background to #50B9AD.
- Add a Text Component to the header.
- Rename it: titleTextBox.
- Configure the following:
TEXT
Provider Enrollment Application
- Click on Appearance.
- Change the text to Bold ( Click).
- Change the text to the font color to #FFFFFF.
To update the Navigation Component:
- Go to Appearance > Item appearance.
- Change the text to the font color to #FFFFFF.
Update the Appearance of the inboxTable and providerListTable Components with the following:
Appearance > Table headers |
|
Background | #2E2F30FF |
Text | Bold |
Text Color | #FFFFFF |
Update the Appearance of the searchFormTitle component with the following:
Background | #50B9AD |
Text | Bold |
Text Color | #FFFFFF |
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article