Reference a dynamic list of system constants
Comments
-
I have a form with a drop-down which I would like to populate with a list of Strings from the system constants. So my questions are two-fold:
1) Is there a way to create a list of Strings in the system constants? I know that you can make a lookup list, or a single string, but I see no way to make a list of regular strings.
2) If there is no way to make a list of strings, is there a way to dynamically make a list using individual strings FROM the constants? (e.g. A list of strings which adhere to the same naming convention)
-
Hi there,
There is a way to generate a list of string values, but we should stay away from manipulating System Constants as those should left as they are.
I’ve built and attached an example of how you may set-up a drop down element to pick up a list of values:
First, you’ll want to create a datatype. For the purposes of this example, I’ve created a simple Database named “ExampleStrings” (this will house the dropdown responses). Note: Make sure to tick the “Enable Actions” check box! This will be important later. I created a string data called “Options”. This is the specific field we’ll grab for the drop down later. (See EnableActions.png attachment)
Now that we have a datatype (and configuration folder), I created an “Example Form” which has a drop-down element. This is where we select what populates the drop down. For List Input Source, select “Flow”, for Display Field, select Options, and for Type select our database, in this case “ExampleStrings”. This should also create a Flow ID option where you can choose to pick/create/edit a flow which will generate the data.If you click Edit, you’ll see my created flow with one step, Fetch Database Entities (Fetch Entities). If you’ll look in the properties panel, you can see there is a Type Name in the Entity Fetch Definition. This is where you’ll select the database as the type (ie: ExampleStrings).
For the end step, you’ll see one piece of data called “Database Options” with the database selected as the type. This is where the “Is List” box should be ticked. This will be mapped to the entity results box.
Our drop down is ready to pull data! Now we need to give it some data which could be imported from a csv file, or by creating a user action.
Creating a User Action:
Creating an “Add Options” Flow:
Navigate to that EntityConfiguration folder that was created when we made the ExampleString datatype. This is where you configure all of the user actions you’d like to perform. At the bottom of the page, you can select User Actions > Create Add Entity Action. I’ve named this flow Create Entity Flow 1.In this flow, I made a form allowing a user to type in a new option through a text box. This string will then go to a Create ExampleStrings step (location in steps | User Defined Types > Database Structures > ExampleStrings > Create ExampleStrings). In this step, there is an Input named Item to Create. Here, you’ll select Build Data and for the Options field, select from flow and select the text box output from the previous form (in this case, Option to Add).
Creating a “Delete Option” Flow:
Navigate to User Actions > Create User Action. For this example, I’ve named it “Delete Option”. The two steps in this form are the form with the drop down and a Delete ExampleStrings step (located in User Defined Types > Database Structures > Example Strings > Delete ExampleStrings). The Delete ExampleStrings step will need an ID which we can grab from the forms output, ExampleDatabaseStrings.ID. You now have a delete step to get rid of options you’d like to omit!At this point, you should be able to open up the Example Page and click ADD NEW OPTION. This will kick off that flow we’ve just created and you can add values to this data structure.
Finally, if you right click the Example Form and hit Run Form, you’ll see everything you’ve added to the datatype as an option!
[i]edited by Scott@decisions.com on 8/16/2019[/i]
Howdy, Stranger!
Categories
- 4.1K All Categories
- 61 General
- 11 Training
- 201 Installation / Setup
- 1.1K Flows
- 106 Rules
- 260 Administration
- 212 Portal
- 489 General Q & A
- 693 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 51 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 178 Pages
- 5 Process Mining
- New Features
- 178 Datastructures
- 69 Repository
- 219 Integrations
- 28 Multi-Tenant
- 27 SDK
- 76 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 66 Lunch And Learn Questions