How do I show a checkbox auto-selected on a creation of page?

I want to show a checkbox pre-selected on the creation of a page.

To achieve this functionality, we can use the new Javascript function feature i.e. Invoke function because our Checkbox requires a value in the Code: Value pair which can not be achieved through the Copy Data task.

Suppose the key for the concerned index in my enumeration is A, and the JS function for this will be:

function getDefaultValue(value) {
    return JSON.stringify([value]);
}

Now, we will map this Invoke Function to the OnPageCreate Event of the particular page. In the output location parameter of the function, we will map the Checkbox element. We will reload the checkbox element only before this Invoke function.

1 Like

Iā€™d like to add an additional point here. The checkbox functionality requires handling data output as a list of strings, where each string represents a code to be selected. The previously mentioned solution applies only when you have a single string and need to display the checkbox as selected. If the data is already in the form of a list of strings (codes), no further action is needed.

1 Like