Piping Expressions
CONTENTS
What information can be added via piping?
How to write a piping expression
Piping data into mission fields
Piping in an advanced logic rule
Examples of piping expressions
What are piping expressions?
Piping expressions update Mission fields with a dynamic value from other GoSpotCheck objects, task responses, advanced logic variables, or deep links. For example, a piping expression can be used to add a user’s name to mission instructions or task titles, creating a more personalized experience. Piping expressions can be added to the following fields:
- Mission instructions
- Task titles
- Task descriptions
- Section titles
- Section descriptions
- Advanced logic rule text editor
While a company must have advanced logic enabled to use piping, piping expressions can be entered in supported fields without writing an advanced logic rule.
What information can be added via piping?
The following information can be dynamically added to supported fields through piping:
Object | Supported Values |
Users |
|
Places |
|
Missions |
|
Tasks |
|
Deep Links |
|
Variables |
|
How to write a piping expression
Piping expressions are added to supported fields with curly brackets {}.
- When piping a field from a GoSpotCheck object (mission, place, or user), the accepted format is {object_name.field_name}. For example, {user.first_name} dynamically adds the logged-in user’s first name to the specified field.
- When piping a task response value, the accepted format is the task number as defined in the structure panel. If a Mission contains multiple sections, use the format SectionLetter.TaskNumber. For example, {SA.T1} dynamically inserts the task response value from the first task in the first section of the Mission.
- When piping a task identifier, type the name of the identifier between curly brackets.
- When piping an advanced logic variable, type the name of the variable between curly brackets.
- When piping a deep link, you will need a key value associated with the link. The accepted format is {Deep_link(‘key_name’)}.
Piping data into mission fields
To write a piping expression on the Build tab:
- Navigate to an applicable field in the mission builder (mission instructions, task title, task description, section title, or section description). Enter an open curly bracket to start a piping expression. A dropdown will auto-populate with a list of suggested fields that can be added to the expression:
- Select a field from the dropdown or type the name of the field within the populated curly brackets. A piping expression will appear red until it is complete. In this example, the logged-in user’s email will automatically populate in the mission instructions:
- The auto-populated list of suggestions groups piping values by Starts with and Similar to. Values under Starts with begin with the same word or letter that has been entered into the expression field. Values under Similar to are suggested because they have a relation to the word or letter that has been typed into the expression field.
- Add as many piping expressions to a single field or to multiple fields as needed.
Task responses can also be piped into supported mission fields, including task titles. A common example is the use of conditional information based on an answer selection of ‘Other’. For example, multiple choice and multiple select tasks often include a list of options and ‘Other’ as a catchall for anything not listed. Typically, this ‘Other’ selection is followed up by another task to provide more information. This task response can be piped into a task title to remove any ambiguity for the user.
In the example below, the ‘Other’ product on display that is provided in the short answer task will be piped into the subsequent count task’s title, dynamically equipping the user with clear information on the count they are providing.
Piping in an advanced logic rule
To include a piping expression in an advanced logic rule:
- Navigate to the logic tab. In this example rule, we will create a text variable named mission_instructions whose value is defined via a calculation rule. The rule sets the value for mission_instructions as ‘Hello, {user.name}. Welcome to {place.name}. Please complete the following mission only once per month.’ This rule includes two piping expressions, dynamically referencing both the user’s name and the place name.
- Insert the variable name between curly brackets into an applicable field. In this example, the variable will be leveraged in mission instructions.
- The mission instructions will appear to the user as: Hello, User Name. Welcome to Place Name. Please complete the following mission only once per month.
Piping can be used in advanced logic rules in a multitude of ways. For more information on advanced logic variables, click here.
Examples of piping expressions
Object | Field | Use Case | Piping Expression | Mobile User Experience |
Mission property | Mission instructions | Dynamically insert a mission property value into mission instructions. | This Mission pertains to {mission.category}. Do not complete if you are not at a {mission.category} account. | This Mission pertains to Example Category. Do not complete if you are not an Example Category account. |
Places | Task title | Dynamically insert place address into task title. | Are you at {place.address}? | Are you at 12345 S. Example Street? |
Users | Task description | Dynamically insert the user’s full name into a task description. | Hello, {user.name}! Please complete this task and submit only one response. | Hello, Joe Smith! Please complete this task and submit only one response. |
Task answer option | Section title | Dynamically insert an answer option from a task into a section title. |
{SA.T1.A1} Display Section A (SA), Task 1 (T1): Which products are on display? A1.) Chips A2.) Popcorn A3.) Crackers |
Chips Display |
Variables | Task title | Dynamically insert a calculated value from an advanced logic rule into a task title. | Is {total_case_count} the correct number of total cases? | Is 25 the correct number of total cases? |
Task Response Value | Task title | Dynamically insert a task response value into a subsequent task's title. | How many {T1} are on display? | How many Example Response Value are on display? |