External Parameters

This article describes how to configure the external parameter function and provides details on each of its properties.

Who can use this feature?

The External Parameters function can be used by those with the Builder subscription plan.

For more details, see our pricing comparison matrix.

The external parameter function allows values to be passed into and out of a Squirrel project. This could be used to pre-filter or customize a view or to send data to another website/page.

External Parameters Properties

The properties panel consists of 2 drawers:

The properties in the RECEIVE DATA drawer are used to configure parameters for inbound data.

The properties in the SEND DATA drawer are used to configure outbound data.

RECEIVE DATA

  • List of data coming in - This is a list of inbound parameters. Each item represents a variable that can receive data.

    • Add additional parameters by clicking the + icon.

    • Select the parameter to be configured by clicking on it in the list.

    • Delete parameters by selecting the parameter in the list and clicking the bin icon.

  • Name - The name of the parameter (displayed in the list below). Give the parameter a meaningful name to help identify its purpose.

  • Type - Choose from:

    • GET

    • JS Message

  • Destination - Bind the Destination property of the Value to a cell in the spreadsheet that has been set aside to receive the parameter value.

Using Type GET (for simple application)

Selecting the GET option requires parameters to be passed via the URL of the web page hosting the Squirrel project. For example www.animalfacts.com?Animal=Squirrel

When the web page containing the Squirrel project is loaded, the External Parameters function will retrieve the parameter value from the page URL and add that to the Destination cells in the spreadsheet. This only happens on page load.

Using Type JS Message (for complex requirements or where security is important)

Using the JS Message method is similar to the GET method, except that the parameter values are passed via JavaScript code into the Squirrel project. The basic steps required are to:

  • Add a Squirrel project to a web page.

  • Add a JavaScript function to the web page that will pass parameter values into the Squirrel project.

The code can be triggered by various methods and can be used repeatedly without having to reload the web page.

There are many ways to accomplish this. Watch this video for more information or discuss your options with a friendly Web Developer.

SEND DATA

  • Enable sending data - Select this to configure the function for outbound parameters. Once enabled the following properties will appear:

  • Data going out - This is a list of outbound parameters. Each item represents a variable that can send data.

  • Name - The name of the parameter (displayed in the list above). Give the parameter a meaningful name to help you to identify its purpose.

  • Send to - Choose from:

    • Parent

    • Web View ID

  • Unique ID (in combination with send to option Web View ID) - Bind to a cell containing the Unique ID of the web view component that should receive the data from this parameter.

  • Value - Bind to a cell in the spreadsheet that contains the value to be sent.

Using Send to Parent

The Parent option will pass values out of the Squirrel project to the host web page. A JavaScript function added to the web page will receive the values.

Using Send to Web View

Use a web view component to ‘nest’ a Squirrel project inside another Squirrel project. When the web view component is configured to display to another published Squirrel project, a parent-child relationship has effectively been created and data can be sent and received between them.

To send data to a parent project, make sure the containing web view is configured to receive it. To do this:

Select the web view component that is used to display the child Squirrel project, and check the Connect to external parameters option in the properties panel.

Note the Unique web view ID value that is displayed. You will need to enter this value when configuring the send parameter in the child project so that the parent project receives the data correctly.

Bind the Unique ID property to the spreadsheet cell containing the Unique web view ID from the parent project.

NB: External parameters can not be tested in design, debug, or preview modes. A project must be published before it can receive or send data.

Last updated

Logo

Copyright © 2019 - 2024 InfoSol Ltd. All rights reserved.