LaunchOptions property
The launch options of the app, which are values set in the address (URL) used to launch it.
Launch options can be used to customize the app for the context it's running in, including its host page (if it's embedded), a certain client, an interest rate or something else. As a result, you can create a single adaptive app instead of creating multiple apps with small variations.
Here’s what a standard app address looks like:
connect.calcapp.net/?app=abc123
And here's the same app with launch options:
connect.calcapp.net/?app=abc123#Client=Acme&InterestRate=3.5
This property is a read-only property, meaning that no formula can be assigned to it.
Setting launch options
Launch options are defined in the inspector in Calcapp Creator. A launch option is either a number, a text string or a logical value (TRUE or FALSE).
In an address, numbers can be written using either decimal points or decimal commas. (Thousands separators are not supported.)
Text strings often need to be percent-encoded. Spaces, for instance, are represented as %20. Use Calcapp Creator's publishing tools to have it encode text strings for you.
Accessing launch options
Launch option values are accessible from formulas using App.LaunchOptionsApp,LaunchOptions. Continuing the example above, access the corresponding values using formulas like these:
Examples
Returns the value of the DefaultQuantity launch option if one has been provided, or 1 otherwise. This formula may be associated with the Value property to set a default value for a quantity field.
This formula is associated with the Value property of a field showing a future value of an investment. It does the calculation using the InterestRate launch option, enabling the same financial calculator to work with different interest rates.
This formula is associated with the Visible property of a text
box containing information for the client Contoso. The formula ensures
that the text box is only shown if the launch option Client
has been set to "Contoso".
This formula is associated with the BackgroundColor property of the first screen. It ensures that the clients Contoso and Acme get background colors matching their particular brands, depending on the launch options set.
This formula is associated with the FirstScreen property of the app. It ensures that a special first screen is used if the client is Acme.