Zum Hauptinhalt gehen

Use DataLink to populate form

Kommentare

1 Kommentar

  • Permanently deleted user
    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
    Hope that helps,

     

    -Amanda

     

     
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.