Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
Training Exercise
You have now learnt how to create and configure Actionflows that require sophisticated processing logic in PhixFlow. To reinforce the techniques you have learnt, complete these assignments.
Don't worry, this is not an exam. You can use the Help to broaden your understanding and assimilate knowledge. A number of hints have been provided; use these if you are struggling as each hint gives you more information on the solution.
Tip |
---|
A training instance is required to complete these assignments. Use the application: Actionflow Intermediate Application. |
.Remember to close and reopen your screen if you do not see the changes you expect.
Expand | ||
---|---|---|
| ||
You may find it useful to use the debug function within your Expressions to add messages to the System Console. |
Assignment 1
Difficulty Level:
Task 1
On the Government Organisations screen, create an Actionflow on the Run API button that retrieves the JSON data from this API: https://www.gov.uk/api/organisations, and record the results to the Output Attributes, as defined in the table below
Excerpt Tip Ensure you open the above link to view the JSON. We recommend viewing the data in Google Chrome, using the 'Pretty print' option, or in Notepad++, using the JSONTools plugin, or in Visual Studio Code using the extension 'Prettier'.
- Save the data to the table, Gov_Organisations
Attribute Name | JSON Element |
---|---|
Name | title |
UID | content_id |
ClassName | organisation_brand_colour_class_name |
Status | govuk_status |
URL | web_url |
Expand | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Remember to use a
|
Expand | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
The table, Gov_Organisations, can be found in the |
Expand | ||
---|---|---|
| ||
If you are struggling to set up the JSON action, review the example in 2.13 JSON Action Configuration as the JSON action setup is very similar. |
.
Expand | ||
---|---|---|
| ||
Actionflow Setup HTTP Action Setup Mappings - HTTP to JSON JSON Action Setup Mappings - JSON to Save Save Action Setup |
Task 2
- Modify the Actionflow on the Run API button so that where the ClassName attribute receives the result, "ministry-of-justice", set the Justice boolean attribute to Y
- Then converge both flows of data back together before completing the Save action
Requirements
For the purposes of this training exercise, you must:
- Use a
actionInsert excerpt _action_gateway _action_gateway nopanel true - Use a
actionInsert excerpt _action_converge _action_converge nopanel true - Not add any further Output Attributes to the
actionInsert excerpt _action_json _action_json nopanel true
Expand | ||
---|---|---|
| ||
If you weren't able to find the solution adhering to the requirements, you may have been able to achieve the result using a different method. For example:
Actionflow Setup Mappings - JSON to Gateway Mappings - Gateway to Calculate Calculate Action Setup Mappings - Calculate to Converge Mappings - Gateway to Converge Converge Action Setup Mappings - Converge to Save |
Task 3
Modify the Actionflow on the Run API button to initiate a new phase after the Save action. In the new phase send an email to yourself stating that the API has been successfully called. Set the To field on the
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Expand | ||
---|---|---|
| ||
To trigger the next phase, the last action node in the first phase (Save) must be connected to a Start Phase action node. |
Expand | ||
---|---|---|
| ||
Assignment 2
Difficulty Level:
Task 1
Create an Actionflow on the Duplicate Check button on the Government Organisations Form screen that checks for duplicates. This Actionflow should:
- Take the value that the user has entered into the Title field
- Embed the Actionflow, Gov Org Validation to standardise the the Title format
- Look up into the Gov_Organisations data for matches
- Count the number of matches returned
- Output this count back onto the Government Organisations Form
Expand | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Click
|
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
The Gov Org Validation Actionflow requires the Title attribute to carry out the validation. Ensure this is mapped into the embedded Actionflow node and the Output Attribute from the Gov Org Validation Actionflow is mapped back to the form. |
.
Expand | ||
---|---|---|
| ||
Actionflow Setup Mappings - Input Connection Point to Input Mappings - Input to Embedded Actionflow Mappings - Embedded Actionflow to Calculate Action Mappings - Incoming to View Action Mappings - Outgoing from View Action View Action Setup Calculate Action Setup Mappings - Calculate to Output Mappings - Output to Output Connection Point |
.
Assignment 3
Difficulty Level:
Task 1
Modify the Actionflow on the Save button on the Government Organisations Form by embedding the Actionflow, Gov Org Validation, before the Save action.
.
Expand | ||
---|---|---|
| ||
Actionflow Setup Mappings - Input Connection Point to Input Mappings - Input to Embedded Actionflow Mappings - Embedded Actionflow to Save |
Testing
Ensure you test your Actionflows are working, and where relevant, test for both a positive and negative result. For example, on your form, enter a Title you know exists in your data to display a duplicate and a Title you know doesn't exist.
Once you have verified your Actionflows are working, the screens and data can be modified in any way you wish. For example, you may wish to enhance the Email phase of the Actionflow that runs the API to pass in more detail to the Email action, such as, the number of records returned from the API call.