Overview
It's important for end-users to understand when an error occurs in an application. Configuring a pop-up error message using a Plug-In component lets end-users know of errors and report them to developers. The method explained in this how-to guide creates a pop-up modal informing users when an error occurs from a Plug-In component API call.
Configuring a Pop-Up Error Message
For this example, configure a Plug-In component to generate an error. Then, configure a Panel component to display the error to the end-user.
Create an Improperly Configured API Call
First, create a broken API call so you can prompt a pop-up error message. If you are creating error handling for an existing Plug-In component, skip to Create a Pop-up Error Message section of this article.
Configure the Field Group Component
The Field Group component acts as a container for the components that follow.
In the Module Builder, drag and drop a Field Group component onto your canvas.
In the Property ID and Canvas Label Text fields, enter
fgPlugin
.Click Save Component.
Configure the Plug-In Component
The goal of this guide is to create an error. So, you'll configure the Plug-In component to reference a module ID that does not exist.
Drag and drop a Plug-In component onto your canvas, placing it inside the fgPlugin Field Group component.
In the Property ID and Canvas Label Text fields, enter
pluginName
.From the Internal Services drop-down, select Execute Module. The Data Source URL autopopulates with placeholder text.
In the Data Source URL field, replace
/fbu/uapi/modules/{moduleId}/execute with /fbu/uapi/modules/5ece9eee597dbe01f8ef308cs/execute.
For this example, the Data Source URL is an invalid address. The invalid address acts as an error for the purpose of demonstrating an error message popup.
Click Save Component.
Configure the Button Component
Configure a Button component to trigger the improperly configured Plug-In component.
Drag and drop a Button component onto the canvas, placing it inside the fgPlugin Field Group component and below the pluginName Plug-In component.
In the Property ID field, enter btnTest.
In the Label Text field, enter
Test Error
.Navigate to the Actions settings.
From the Action Type drop-down, select Event.
From the On Click drop-down, enter or select pluginName.
Click Save Component.
Create a Pop-Up Error Message
The following steps use a Calculator component to retrieve error codes from a Plug-In component. Then, it sends the codes to the Panel component to display as a pop-up modal to the end-user.
Configure the Panel Component
This Panel component contains the error message handling, and also acts a modal to display errors.
Drag and drop a Panel component onto your canvas, placing it below the fgPlugin Field Group component.
In the Property ID field, enter panelErrorHandling.
Click Save Component.
Configure the Calculator Component
Configure a Calculator component to extract and concatenate the error message and code from the integratorErrors
object.
Drag and drop a Calculator component onto the canvas, placing it inside the panelErrorHandling Panel component.
In the Property ID and Canvas Label Text fields, enter
calcErrorHandling
.In the Inputs table, enter the following:
The
integratorErrors
value is apart of a module's data object. In Express View, you can view this key array by opening the DevTools Console and running the Angular Command.In the Outputs table, enter the following:
You'll create two Hidden components in the next section that match these Output IDs.
In the Post Trigger field, enter or select
ruleIntegratorErrors
Click Save Component.
Configure the Hidden Components
Configure two Hidden components to contain the error code and error messages retrieved by the calcErrorHandling Calculator component.
Drag and drop two Hidden components onto your canvas, placing them inside the panelErrorHandling Panel component and below the calcErrorHandling
Calculator component.
In each component's Property ID and Label Text field, enter the following:
After configuring each component, click Save Component.
Configure the Decisions Component
The Decisions component creates a pop-up error message using the Panel component.
Drag and drop a Decisions component onto the canvas, placing it inside the panelErrorHandling Panel component and below the Hidden components.
In the Property ID and Canvas Label Text fields, enter
ruleIntegratorErrors
.In the Inputs table, enter the following:
In the Outputs table, enter the following:
The
popError
type triggers the panelErrorHandling Panel component to display data in a modal, regardless of the Panel component's display settings.In the Conditionals table, enter the following:
If you want a customized message, update the Conditionals field. For example, in the panelErrorHandling_popError column,
enter =CONCATENATE('Enter your customized text here. ',errorCode,' ',errorMessage).
Click Save Component.
Learn more about the CONCATENATE function here: https://support.office.com/en-us/article/concatenate-function-8f8ae884-2ca8-4f7a-b093-75d702bea31d.
Update the Plug-In Component's Error Trigger
Lastly, set calcErrorHandling Calculator component as the error trigger of the Plug-In component. Whenever an error occurs in the Plug-In component, the calcErrorHandling
Calculator component fires.
To update your Plug-In component's error trigger:
Hover over the pluginName Plug-In component.
A 4-button toolbar displays above the component on hover-over.
Click the (Settings) button.
Navigate to the Actions settings.
In the Error Trigger field, enter
calcErrorHandling
.Click Save Component.
Save your module.
Here's how your completed module looks in the Module Builder:
Preview your module in Express View and click Test Error. A modal displays the error generated by the improperly configured Plug-In component.
If your pop-up is blank, test your component settings for the correct spelling. In equations, verify your work contains straight quotation marks rather than curly quotation marks. Double-check your spelling and quotation marks, save your updates, and try again.
Overview
It's important for end-users to understand when an error occurs in an application. Configuring a pop-pp error message using a Plug-In component lets end-users know of errors and report them to developers. The method explained in this how-to guide creates a pop-up modal informing users when an error occurs from a Plug-In component API call.
Configuring a Pop-Up Error Message for Plug-Ins
For this example, configure a Plug-In component to generate an error. Then, configure a Panel component to display the error to the end-user.
Create an Improperly Configured API Call
First, create a broken API call so you can prompt a pop-up error message. If you are creating error handling for an existing Plug-In component, skip to Create a Pop-up Error Message section of this article.
Configure the Field Group Component
The Field Group component acts as a container for the components that follow.
In the Module Builder, drag and drop a Field Group component onto your canvas.
In the Property ID and Canvas Label Text fields, enter
fgPlugin
.Click Save & Close.
Configure the Plug-In Component
The goal of this guide is to create an error. So, you'll configure the Plug-In component to reference a module ID that does not exist.
Drag and drop a Plug-In component onto your canvas, placing it inside the fgPlugin Field Group component.
In the Property ID and Canvas Label Text fields, enter
pluginName
.From the Internal Services drop-down, select Execute Module. The Data Source URL autopopulates with placeholder text.
In the Data Source URL field, replace
/fbu/uapi/modules/{moduleId}/execute with /fbu/uapi/modules/5ece9eee597dbe01f8ef308cs/execute.
For this example, the Data Source URL is an invalid address. The invalid address acts as an error for the purpose of demonstrating an error message popup.
Click Save & Close.
Configure the Button Component
Configure a Button component to trigger the improperly configured Plug-In component.
Drag and drop a Button component onto the canvas, placing it inside the fgPlugin Field Group component and below the pluginName Plug-In component.
In the Property ID field, enter btnTest.
In the Label Text field, enter
Test Error
.Navigate to the Actions settings.
From the Action Type drop-down, select Event.
From the On Click drop-down, enter or select pluginName.
Click Save & Close.
Create a Pop-Up Error Message
The following steps use a Calculator component to retrieve error codes from a Plug-In component. Then, it sends the codes to the Panel component to display as a pop-up modal to the end-user.
Configure the Panel Component
This Panel component contains the error message handling, and also acts a modal to display errors.
Drag and drop a Panel component onto your canvas, placing it below the fgPlugin Field Group component.
In the Property ID field, enter panelErrorHandling.
Click Save & Close.
Configure the Calculator Component
Configure a Calculator component to extract and concatenate the error message and code from the integratorErrors
object.
Drag and drop a Calculator component onto the canvas, placing it inside the panelErrorHandling Panel component.
In the Property ID and Canvas Label Text fields, enter
calcErrorHandling
.In the Inputs table, enter the following:
The
integratorErrors
value is apart of a module's data object. In Express View, you can view this key array by opening the DevTools Console and running the Angular Command.In the Outputs table, enter the following:
You'll create two Hidden components in the next section that match these Output IDs.×
In the Post Trigger field, enter or select
ruleIntegratorErrors
Click Save & Close.
Configure the Hidden Components
Configure two Hidden components to contain the error code and error messages retrieved by the calcErrorHandling Calculator component.
Drag and drop two Hidden components onto your canvas, placing them inside the panelErrorHandling Panel component and below the calcErrorHandling
Calculator component.
In each component's Property ID and Label Text field, enter the following:
After configuring each component, click Save & Close.
Configure the Decisions Component
The Decisions component creates a pop-up error message using the Panel component.
Drag and drop a Decisions component onto the canvas, placing it inside the panelErrorHandling Panel component and below the Hidden components.
In the Property ID and Canvas Label Text fields, enter
ruleIntegratorErrors
.In the Inputs table, enter the following:
In the Outputs table, enter the following:
The
popError
type triggers the panelErrorHandling Panel component to display data in a modal, regardless of the Panel component's display settings.In the Conditionals table, enter the following:
If you want a customized message, change the Conditionals field as follows: In the panelErrorHandling_popError column enter
=CONCATENATE('Enter your customized text here. ',errorCode,' ',errorMessage).
Click Save & Close.
Learn more about the CONCATENATE function here: https://support.office.com/en-us/article/concatenate-function-8f8ae884-2ca8-4f7a-b093-75d702bea31d.
Update the Plug-In Component's Error Trigger
Lastly, set calcErrorHandling Calculator component as the error trigger of the Plug-In component. Whenever an error occurs in the Plug-In component, the calcErrorHandling
Calculator component fires.
To update your Plug-In's error trigger:
Hover over the pluginName Plug-In component.
A 4-button toolbar displays above the component on hover-over.
Click the (Settings) button.
Navigate to the Actions settings.
In the Error Trigger field, enter
calcErrorHandling
.Click Save & Close.
Save your module.
Here's how your completed module looks in the Module Builder:
Preview your module in Express View and click Test Error. A modal displays the error generated by the improperly configured Plug-In component.
If your pop-up is blank, test your component settings for the correct spelling. In equations, verify your work contains straight quotation marks rather than curly quotation marks. Double-check your spelling and quotation marks, save your updates, and try again.×