Passing Parameters to the AEK from App Builder
The aim of this blog is to give a guide on how to pass useful values from the App Builder into an AEK integration. This topic assumes you’re already familiar with:
- How to create and publish AEK menu options
- How to create and deploy AEK projects
If you’re not, please review these pages:
The corresponding GitHub project to this blog can be found here.
|1.||Create an AEK project that you would like to pass a parameter into.|
|2.||Edit the runserver.yaml file to simulate passing in parameters from an “action link.” Make sure the devPath is correct or else you will get errors that your screen cannot be found.|
The runserver.yaml file should look something like this:
homepage: menu: replace: - desc: Action Link Parameters screenName: action-link-parameters devPath: "/aek/c/action-link-parameters?test_param=firebrick"
Later on when the AEK project has been deployed to the app environment, these parameters will come from the App Builder configuration.
|3.||In your AEK project, you can obtain the parameter being passed. There are two ways to do this, one is from the client side and one is from the server-side:|
The example project showcases both ways of obtaining these parameters. Please find the “exlib-action-link-parameters” project here for more details. The example project shows the difference in speed between these two methods. The project code also details the specifics of how they work.
|4.||Deploy your own custom project to your app environment or deploy the example given. Once the project has been deployed to your app environment, you will need to set up the AEK menu option. This is required for the Action URL later on.|
|5.||After setting up your AEK menu option, note down the AEK menu option ID, either from the form itself or from the address bar. You will need the “AEK” prefix that comes before the ID. This ID will be used in the next step.|
Here is an example:
|6.||Now that the AEK menu option has been set up, go to your new tile within the App Builder and assign it an Action URL.|
The URL should look something like this:
campusm://loadaek?toolbar=[ menu option ID ]&[ parameter name ]=[ parameter value ]
Here is an example:
|7.||The example project allows you to pass in a variable called “test_param” and this changes the color that displays on the page. This example is passing in the color “firebrick.” When testing locally, “firebrick” is passed in from the runserver.yaml file.|
Here is what the example project should look like once it’s up and running: