Add an Assign Variable Action

You use an Assign Variable action to assign a local, page, flow, or application variable a value. This action can also be used to create a local variable.

For example, if your action chain sends a request to a GET endpoint, you can use the Assign Variable action to map the response to a page variable that's bound to a page component. Or, suppose you want to capture the ID of an item selected in a list. You could use a Selection event to start an action chain that assigns the selected item’s ID to a variable.

To use an Assign Variable action to create a local variable:

  1. Enter the variable's name in the Variable field and hit Enter on your keyboard.
  2. Use the Type drop-down to select its data type.
  3. If necessary, use the Value field to assign it a value.

To use an Assign Variable action for a value assignment:

  1. Add the action in one of three ways, depending on your preference and where you want it added:
    • Drag the action from the Actions palette onto the canvas, dropping the action either at the bottom edge of the action it is to follow, or at the top edge of the action it is to precede.
    • Double-click the action in the Actions palette to add it to an empty canvas or to the end of an action chain.
    • On the canvas, select the action you want the new action to follow, then double-click the new action in the Actions palette.
  2. If you need to create a variable for the assignment, click the Variable property's Create link, otherwise, start to type the variable's name in the field and select it when it appears. Alternatively, click the down arrow and choose the Page, Flow or Application variable. In this example, the page variable fullName is assigned the result from a module function:

  3. To set the variable's value, hover over the far-right side of the Value property and either click the down arrow to choose the value, or click fx to create an expression for the value.

If you need to do another assignment, click the + Assign Variable button in the Properties pane:
Description of jsac-assign-another-var.png follows
Description of the illustration jsac-assign-another-var.png

Then make the assignment using the Variable and Value fields that appear for the new variable assignment:
Description of jsac-assign-another-var2.png follows
Description of the illustration jsac-assign-another-var2.png

Use Filter Builder to Create Filter Criteria for an SDP

If you're using an SDP to provide a table or list's data, and you'd like to filter out rows, you can use the Assign Variable action to create and assign the filter criteria to the SDP's filterCriterion property. For further details about using an SDP to filter a table or list's rows, see Filter Data by Filter Criteria.

When the Assign Variable action's Variable property is set to an SDP's filterCriterion property, the Filter Builder appears under the Variable property for you to create the filter criterion. To directly work with the code, click the Code button. For details, see Filter Builder's Code Editor.
Description of jsac-assign-action-pick-sdp.png follows
Description of the illustration jsac-assign-action-pick-sdp.png

To use the Assign Variable action's Filter Builder to create the filter criterion for an SDP:

  1. Click the Filter Builder's Click to add condition link:

  2. For the first Attribute textbox, enter the name of the column (field in record, like "city") that you want compared against a specific value (like "Tokyo").
  3. For the Operator drop-down list, select the operator for the criterion.
  4. For the second Attribute textbox, enter the specific value to compare against, or select the variable that contains the value. For instance, the value could be stored by a page variable that was bound to an Input Text component for a user to enter the value.

  5. To add another condition, click the Add Condition link to add one with an AND or OR operator, or click the Add Group link to add a group of conditions that are to be evaluated together (conditions enclosed in brackets). To combine conditional expressions with the AND operator, select Match All, and to combine them with the OR operator, select Match Any:

  6. Click Done when you're finished.

Filter Builder's Code Editor

You can use the Filter Builder's Code tab to view and edit the filter's code. After defining a condition on the Builder tab, you will see that the Code tab contains an attribute, op and value property.

Here's an example of a filter with two conditions combined by an AND operator:

 "op": "$and",
 "criteria": [
   "op": "$eq",
   "attribute": "name",
   "value": "{{ $page.variables.filterVar }}"
   "op": "$eq",
   "attribute": "id",
   "value": "{{ $page.variables.idVar }}"
In this example:
  • The Oracle JET operator is "$eq" (it must include the dollar sign (“$”)).
  • The attribute property is set to the name of the field (column) that you want to be evaluated against the value property.
  • The value property ($page.variables.customerListSDP.filterCriterion.criteria[0].value) is mapped to a page variable ($page.variables.filterVar) that holds the value to be evaluated against each field (column) value.