Form Link to Query

This case study illustrates how, from a profile form, you can create a Form Link that will run a Query to which you can pass runtime variables, most commonly the primary key of the record that the user is visiting. You could take this same link and put it into a hyperlink control on a Form.

For example, from an Event Profile, you could have a link that will run a query of Sessions for that particular event, as shown:

Event Profile, click the Form Link:

Form Link on profile page

After clicking the link, a Query is run that outputs a list of sessions from the event. The columns you see are the ones from the Query:

Query output

Query

First, go to the Sessions query designer and add a query. The most important part of the query is the condition that selects which Event you want. The condition should use a value like below. You are setting the value to be {EventKey}, which is a made-up variable that you will later on pass in the querystring of the form link, as shown in the next section.

Query

Form Link

Below is the Form Link:

Form Link

Important values:

Internal aspx - DynamicList.aspx?QueryKey=1152AF79-A5D0-493E-B4D8-41CCABC6A714&EventKey={evt_key}

The guid value for the QueryKey parameter must be the GUID of the Query you created above. The querystring variable EventKey is used by the Query condition you wrote earlier, and you are setting its value to be that of the currently selected event by setting the value to {evt_key}.

Note: Although you might think it is valid, the following URL does not parse correctly.

DynamicList.aspx?QueryKey=1152AF79-A5D0-493E-B4D8-41CCABC6A714&evt_key={evt_key}