Using ASP from Isomorphic JS

Hello, I’m starting my learning process with Isomorphic, but I’m trying to identify how can I perform the following:

I’ve created a dynamic form using a asp file as:

isc.DynamicForm.create({
ID: “IntakeForm”,
width: 75,
layoutAlign:“right”,
titleOrientation: “middle”,
fields:[{name: “cmdCallerOptions”,type: “select”, required: true, valueMap: [“Phone”, “Fax”, “Walk In”], defaultValue:“Phone”}]
});

Also, I have another asp file with the following sub:

<%
Dim strSQLConn
strSQLConn = “connection string”

Sub ordertypesGetAll()
Dim objOLEConn
Dim objRs

set objOLEConn = Server.CreateObject("ADODB.Connection")
objOLEConn.Open strSQLConn
if Err.Number &lt;&gt; 0 Then
	Response.Write(Err.Description)
Else
	set objRs = Server.CreateObject("ADODB.Recordset")
	objRs.Open "SELECT LOV_ENTRY FROM dbo.LIST", strSQLConn, 3, 3
	
	Dim intRecords
	Dim intMaxRecords
	if objRs.BOF And objRs.EOF Then
		Response.Write(Err.Description)
	Else
		intMaxRecords = objRs.RecordCount
		While Not objRs.EOF
			if intRecords &lt; intMaxRecords - 1 Then
				Response.Write (chr(34) & objRs.Fields(0) & chr(34) &  ", ")
			Else
				Response.Write (chr(34) & objRs.Fields(0) & chr(34))
			End If
			intRecords = intRecords + 1
			objRs.MoveNext
		Wend
	End If
End If

objRs.Close
Set objRs = Nothing

objOLEConn.Close
Set objOLEConn = Nothing

End Sub
%>

The question is:

How can I replace the valueMap with the response of the asp sub?

Thank you very much.

Two options:

  1. use SelectItem.optionDataSource

Set up a DataSource that represents the valueMap as a single-field record (or two fields if you want to have a difference between the stored and displayed value) and use this as optionDataSource on the cmdCallerOptions field. Given that you have an existing ASP page returning JavaScript, you should be able to have a dataFormat:“json” DataSource talk to that page.

  1. embed .asp code in the middle of the DynamicForm.create() call

This is less clean and solves the problem only on one page, as opposed to creating a reusable service that other pages can use. But it’s very straightforward.