> For the complete documentation index, see [llms.txt](https://deltaclan.gitbook.io/superform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://deltaclan.gitbook.io/superform/superform-v0/navigation-attributes/dynamic-endings.md).

# Dynamic Endings

## Information

**Attribute:** <mark style="color:red;">`superform-ending = [minimun points, maximum points]`</mark> eg. superform-points=\[0,3]

**Apply to**: elements with `superform-element="step"` attribute (*Superform Steps*).

**Description**: Create different endings based on the user's answers or progress, like this example: <https://superform-v1.webflow.io/>.

Point scoring completion is a powerful feature that allows you to create dynamic endings for your forms. With this feature, you can mark a step with an ending attribute (superform-ending) that defines a range of minimum and maximum points required to reach that particular ending.

As the user progresses through the form, they can score points by completing certain actions or answering certain questions (radio buttons or checkboxes). The total number of points scored is calculated dynamically. When the user reaches the final step of the form, the step with the ending attribute that matches their point score will be displayed.

**Multiple steps can be marked as superform-ending, and all of them will be counted as ending steps. However, only one ending step will be displayed based on the user's points. This ending step is always counted as the final step, and the other steps are counted normally.** For example, if you have 10 total steps and 3 ending steps, Superform will consider 11 steps in total. The ending step will be dynamically replaced based on the user's point-scoring, so even if you teleport to the ending step from an early step in the form, the specific scenario will be shown based on the points collected.

This feature can be used in a variety of ways to create engaging and interactive forms. For example, you can use it to create quizzes, assessments, or surveys that provide personalized feedback based on the user's performance.

In the following example, the user selected an option (radio button) which scores 5 points with <mark style="color:red;">`superform-points=5`</mark> attribute, then he is immediately teleported to a step is marked as Ending with <mark style="color:red;">`superform-ending=[5,8].`</mark> &#x20;

<figure><img src="/files/RqENwiyPWCblMiDjeepU" alt=""><figcaption><p>User selects a radio button with <mark style="color:red;"><code>superform-points=5</code></mark> (5 points)</p></figcaption></figure>

<figure><img src="/files/mbihoR7T8fx7MIel7imq" alt=""><figcaption><p>User is teleported to an Ending Scenario that has <mark style="color:red;"><code>superform-ending=[5,8]</code></mark> </p></figcaption></figure>

{% hint style="warning" %}
It is recommended that all Dynamic Endings are placed in the end to avoid mental fatigue, since only 1 ending is always counted as a step.&#x20;
{% endhint %}

{% hint style="info" %}
If you don't need minimum & maximum, but a strict number, then you use superform-ending\[number, number].\
Example: strictly 5 points -> <mark style="color:red;">`superform-ending=[5,5]`</mark>
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://deltaclan.gitbook.io/superform/superform-v0/navigation-attributes/dynamic-endings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
