Use DataLink to populate form
Hi,
Can anyone provide some advice on populating a form in a WorkFlow with the fields a map layers DataLink?
As read-only to start, but eventually I will want to be able to update these fields (coming from a database).
Thanks,
0
-
Hi Brian,
Workflow doesn't have any activities for working directly with data links, so you might find it easier to use a SqlQuery activity to get values directly from your database (the other, less efficient option would be using a WebRequest activity to call the data link endpoint, and then try to get the values out of the JSON from there). There's an example of this activity in the workflow sample site that gets shipped with Essentials "C:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\Default\REST Elements\Sample Sites\Workflow_Samples\Resources\Workflows\Database".
For the Connection string, you can copy it straight from the Data Connection in Essentials Manager.
To get the values from the query result into a form, you'll want to put some Assign activities in the form's Runtime Modifications sequence. To find properties that you can assign values to here, select the DisplayForm activity and press F1, or use this online copy of the same resource (https://docs.geocortex.com/essentials/workflow/latest/help/Default.htm#wf/help/wf_A_DisplayForm.htm%3FTocPath%3DReference%7CActivity%2520Library%7CCommon%2520Client%2520Activities%7C_____4) . They're listed about half way down under "Commonly Used Properties for Built-in Form Items"
As an example, if dataTable1 is the result from the SQLQuery activity, treeCommonName is an empty string variable, COMMON_NAME is the name of a column in your data link, and textBox1 is the ID of a text box on your displayform, then you'll want to use:- Assign: treeCommonName = dataTable1.Rows(0)("COMMON_NAME").ToString()
- Assign: dataTable1 = nothing
- DisplayForm > RunTimeModifications > Assign: form.Find(Of TextBoxFormItem)("TextBox1").DefaultText = treeCommonName
-Amanda0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar