HomeGuidesRecipesAPI
HomeGuidesAPILog In

Project fragment outputs

A fragment Output is a single result that references one or more questions, calculations, data source etc. within the fragment’s question set. The Output is available for reference when the fragment is utilized within another project.

Fragment outputs apply to both Fragment Pages and Fragment Portions alike. Available outputs can be seen by expanding the fragment’s ‘Outputs’ node at the end of the question set. New outputs are available by right-clicking the Output Node.

When a fragment is utilized within another project in Design, the fragment outputs are reference-able just like any other question/answer. Bookmarks may also be added directly to the outputs too.

How to define outputs for Project Fragments (Example)

  • create a fragment type project.
  • add a user prompt and change its question text & answer name to 'Student Name'.
  • go to 'Outputs' node under the question set, right click and add an output.
  • Change output name to 'Student name'. Also set following properties:
    -Type: 'Answer Value'
    -Question: 'Student Name'
    -Answer: 'Student Name'
  • your project will look similar to the following screenshot:

  • save the project fragment.

How to reference defined outputs in a content type project (Example)

  • Open or create a content type project in design.
  • Add the fragment created above.
  • Reference or map the placeholder to the Fragment’s output as shown in the screenshot below:

  • Save your project and test in Produce or SmartIQ Go.

Fragment Output Defaults

When a Fragment Output is added, SmartIQ will automatically select a default answer for the question. When multiple answers are available (Formulas and Multiple Select) the first available answer will be selected.

2085

First Name Answer Selected by Default

2080

A Answer Selected By Default for Formula

For Multiple Choice Questions, there's no need to use a =concat() formula in the middle to pass the string value of the selected value(s) into the fragment output; a new option has been included (Selected Value) and will be selected automatically.

2079

"(Selected Value)" Answer Selected By Default for Multiple Choice

Repeating Actions by Project Fragment Outputs

Project Fragment outputs can be defined as repeaters when they take data from Repeating references such as Repeating Sections or Datasources. In order to define a Fragment Output as a Repeater, you need to define the type as Repeat.

2479

Repeating Fragment Output referencing a question inside a Repeating Section

Then you can easily reference the Fragment Output from a parent project, repeating the Action based on it.

2485

Action can be repeated based on Fragment Output.

In the following example, a fragment page has a 'name' question contained within a repeating section, so that the end user can supply a list of names.

A Fragment Output can be defined as a Repeat Type using a repeating section as a source.

A Fragment Output can be defined as a Repeat Type using a repeating section as a source.

The fragment has two outputs:
RptOutput, which references the repeating section and has a type of 'Repeat'.
NameOutput, which references the 'name' question and answer and has a type of 'Answer value'.

The Action Input of a Fragment's Repeating Output is set to a normal Fragment Output.

The Action Input of a Fragment's Repeating Output is set to a normal Fragment Output.

The main project includes the fragment page. It has a Display Message action which uses the RptOutput as a repeat source. The Action Input references the NameOutput. As a result, when the action is triggered, it runs once for each repeated section in the fragment, passing the related Name answer value each time.