Limbo.Umbraco.Forms.SubmissionLimits 17.1.0-alpha000

Prefix Reserved
This is a prerelease version of Limbo.Umbraco.Forms.SubmissionLimits.
dotnet add package Limbo.Umbraco.Forms.SubmissionLimits --version 17.1.0-alpha000
                    
NuGet\Install-Package Limbo.Umbraco.Forms.SubmissionLimits -Version 17.1.0-alpha000
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Limbo.Umbraco.Forms.SubmissionLimits" Version="17.1.0-alpha000" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Limbo.Umbraco.Forms.SubmissionLimits" Version="17.1.0-alpha000" />
                    
Directory.Packages.props
<PackageReference Include="Limbo.Umbraco.Forms.SubmissionLimits" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Limbo.Umbraco.Forms.SubmissionLimits --version 17.1.0-alpha000
                    
#r "nuget: Limbo.Umbraco.Forms.SubmissionLimits, 17.1.0-alpha000"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Limbo.Umbraco.Forms.SubmissionLimits@17.1.0-alpha000
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Limbo.Umbraco.Forms.SubmissionLimits&version=17.1.0-alpha000&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Limbo.Umbraco.Forms.SubmissionLimits&version=17.1.0-alpha000&prerelease
                    
Install as a Cake Tool

Limbo.Umbraco.Forms.SubmissionLimits

Editor-configurable submission limits for Umbraco Forms 17:

  • Max submissions – the form closes when N entries have been received.
  • One submission per field value – e.g. the same email can only submit once.

Both are toggled per form by the editor through a workflow ("Submission limits"). Enforcement is server-side and covers both the Forms Delivery API (headless) and classic Razor POST. A small status endpoint lets a headless frontend hide a closed form before rendering it. New rules plug into the same pipeline.

Install

dotnet add package Limbo.Umbraco.Forms.SubmissionLimits --prerelease

(--prerelease is needed while only -alpha versions are published.)

Nothing else to register – the composer is auto-discovered.

Editor usage

  1. Open the form → Workflows → add Submission limits (group Security).
  2. Fill in what you need; empty = off:
Setting (Danish label) Effect
Max submissions (Maks antal indsendelser) Form closes when the count of Submitted + Approved entries reaches this number
Message when max is reached (Besked når maks er nået) Message shown instead of the form / on submit
Field that may only be submitted once (Felt der kun må indsendes én gang) Field alias (e.g. email) whose value must be unique across entries (trim + lower-case compare)
Message on duplicate submission (Besked ved gentagen indsendelse) Message returned on a duplicate submit

Backoffice labels follow the logged-in user's language: Danish and English are included, other languages fall back to English (see Localization).

Saving is blocked if max is not a positive integer or the alias does not exist on the form.

The workflow's Execute does nothing; it only carries settings.

What happens on submit

A FormValidateNotification handler runs the Submit rules. If one closes the form, a form-level model error (key "") is added, so the Delivery API answers:

422 { "errors": { "": ["<message>"] }, "status": 422, "title": "One or more validation errors occurred." }

Rules run in registration order; the first closed rule wins. A rule may attach its error to a field instead (RuleResult.Closed(msg, fieldAlias: "tickets") → errors["tickets"]).

Pre-render status endpoint

GET /umbraco/forms/limbo/api/v1/status/{formId}
api-key: <Umbraco:Forms:Security:FormsApiKey>
{ "isOpen": false, "reason": "maxSubmissions", "message": "Der er ikke flere pladser.", "data": null }
  • Protected by the same api-key as the Forms Delivery API ([ValidateFormsApiKey]).
  • Cache-Control: no-store. Never exposes the record count. data is null unless a rule chooses to expose something (e.g. a custom quantity rule returning { "remaining": 96 }) – see Adding your own rule.
  • Only PreRender rules run here (the unique-field rule needs a submitted value and is Submit-only).
  • Returns isOpen: true when the form has no limits workflow.
  • FormStatusController.UrlFor(formId) builds the path if you expose it next to the Delivery API URLs (e.g. in an Enterspeed / Content Delivery API value converter).

Frontend contract: call the status endpoint before rendering; when isOpen === false render message instead of the form. Treat network errors as open – the backend still rejects on submit.

Counting rules

Only UFRecords in state Submitted or Approved count (and are searched for duplicates). Forms also stores Opened / PartiallySubmitted / Resumed rows that the backoffice list hides – they are ignored. No locking: two concurrent submits for the last slot may both pass (overshoot of 1 accepted).

Configuration (optional)

"Limbo": {
  "Forms": {
    "SubmissionLimits": {
      "DefaultMaxSubmissionsMessage": "Der kan ikke længere indsendes svar på denne formular.",
      "DefaultUniqueFieldMessage": "Der er allerede indsendt et svar med denne værdi."
    }
  }
}

Used when the editor leaves a message empty.

Localization

Backoffice texts are localized per backoffice user:

What Where Mechanism
Setting labels/descriptions wwwroot/umbraco-package.json (served from App_Plugins/Limbo.Umbraco.Forms.SubmissionLimits/) Backoffice localization extensions for en and da; keys formProviderWorkflows_limboSubmissionLimits{Setting}{Label\|Description}
Workflow name/description – Not localizable in Forms 17 (the workflow picker shows the C# Name / Description verbatim), so English only
Save-validation errors Lang/da.xml, Lang/en.xml (embedded) Merged into Umbraco's ILocalizedTextService (area limboSubmissionLimits), resolved with the current user's language, English fallback

To add a language, register your own localization extension (e.g. culture: "de") with the same keys in your site's umbraco-package.json, and register a LocalizedTextServiceSupplementaryFileSource for a de.xml with the same area/keys. The English strings in the C# [Setting] attributes are only used when no translation exists.

The visitor-facing default messages (DefaultMaxSubmissionsMessage / DefaultUniqueFieldMessage) are not backoffice texts – set them per site in configuration (see above) or per form in the workflow.

Adding your own rule

public class DateWindowRule : IFormAvailabilityRule {
    public string Alias => "dateWindow";           // becomes "reason" in the status response
    public RulePhase Phase => RulePhase.Both;      // PreRender, Submit or Both

    public RuleResult Evaluate(FormRuleContext ctx) {
        // ctx.Form, ctx.ActiveWorkflows (read your own WorkflowType settings here),
        // ctx.HttpContext, ctx.SubmittedValues (Submit phase only)
        return DateTime.UtcNow > new DateTime(2026, 12, 31)
            ? RuleResult.Closed("Tilmeldingen er lukket.")
            : RuleResult.Open;
    }
}

RuleResult also carries two optional members for richer rules:

  • FieldAlias – on a closed result in the Submit phase, the error is added to that field (errors["<alias>"]) instead of the form (errors[""]).
  • Data – a dictionary merged into the status response's data (and into FormAvailabilityResult.Data). It is collected from every evaluated rule, open ones too (RuleResult.OpenWith(data)), so an open form can still report e.g. remaining. Later rules overwrite equal keys.
public RuleResult Evaluate(FormRuleContext ctx) {
    int remaining = Math.Max(0, max - _sum.SumField(ctx.Form.Id, "tickets"));
    var data = new Dictionary<string, object?> { ["remaining"] = remaining };
    if (remaining == 0) return RuleResult.Closed("Udsolgt", data: data);
    if (ctx.Phase == RulePhase.Submit && Requested(ctx) > remaining)
        return RuleResult.Closed($"Kun {remaining} tilbage", fieldAlias: "tickets", data: data);
    return RuleResult.OpenWith(data);
}

[ComposeAfter(typeof(SubmissionLimitsComposer))]
public class MyRulesComposer : IComposer {
    public void Compose(IUmbracoBuilder builder)
        => builder.FormAvailabilityRules().Append<DateWindowRule>();
}

A rule that throws is logged and treated as open, so a broken rule cannot lock every form.

Notes for Forms 17 extension authors

  • [Setting(View = ...)] must be a real backoffice property editor UI alias (Umb.PropertyEditorUi.TextBox, Umb.PropertyEditorUi.TextArea, Umb.PropertyEditorUi.Integer, …). Legacy v13 names like TextField render as "property editor UI could not be found".
  • Record.RecordFields is keyed by RecordField.Key, not by FieldId.
  • Set Alias on your WorkflowType; the backoffice looks up formProviderWorkflows_{Alias}{SettingPropertyName}Label / Description in localization extensions and falls back to the [Setting] strings. The workflow's own Name / Description are shown verbatim – Forms 17 does not localize them.

Building

./release.sh        # or release.bat → releases/nuget/*.nupkg
dotnet test src

License

MIT – see LICENSE.md.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
17.1.0-alpha000 101 9/17/2026
17.0.0-alpha000 100 9/11/2026