Skip to content

Commit 76a0f8e

Browse files
authored
Merge branch 'main' into workflow-16-0-4
2 parents b93df3c + d081f0a commit 76a0f8e

File tree

6 files changed

+105
-13
lines changed

6 files changed

+105
-13
lines changed

13/umbraco-forms/developer/rendering-forms.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Six parameters can be provided:
1818

1919
- `formId` is the GUID of a form.
2020
- `theme` is the name of a theme. If not provided, the default theme is used (see [Themes](./themes.md)).
21-
- `includeScripts` indicates whether scripts should be rendered with the form (see [Rendering Scripts](./rendering-scripts.md).
21+
- `includeScripts` indicates whether scripts should be rendered with the form. This is necessary for using conditional fields. See [Rendering Scripts](./rendering-scripts.md) for more details.
2222
- `recordId` is an optional existing record GUID, used if editing records via the website is [enabled in configuration](../developer/configuration/README.md#alloweditableformsubmissions)
2323
- `redirectToPageId` is an optional GUID for a content page that, if provided, is redirected to once the form has been submitted. It will be used in preference to post-submission behavior defined on the form itself.
2424
- `additionalData` is an optional dictionary of string values. When provided it will be used as a source for ["magic string" replacements](./magic-strings.md). The data will be associated with the created record and made available for custom logic or update within workflows.
@@ -71,4 +71,4 @@ Similarly, you can reference a form picker property on your page:
7171
{
7272
@await Umbraco.RenderMacroAsync("renderUmbracoForm", new { FormGuid = formId, FormTheme = Model.FormTheme, ExcludeScripts = "1" })
7373
}
74-
```
74+
```

13/umbraco-forms/developer/working-with-data.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,45 @@ Sample script that is outputting comments using a Form created with the default
110110
}
111111
</ul>
112112
```
113+
114+
115+
## Loading a Record From a Submitted Form
116+
When a form is submitted, the submitted form ID and the saved record ID are stored in the `TempData` so they can be referenced.
117+
118+
You can use the FormService and the RecordStorage to get the `Form` and `Record` objects.
119+
120+
Here is a sample code for retrieving a record in a view.
121+
122+
```
123+
@using Umbraco.Forms.Core.Models
124+
@using Umbraco.Forms.Core.Persistence.Dtos
125+
@using Umbraco.Forms.Core.Data.Storage
126+
@using Umbraco.Forms.Core.Services
127+
@inject IFormService _formService
128+
@inject IRecordStorage _recordStorage
129+
@inherits UmbracoViewPage
130+
@{
131+
Guid formId;
132+
Form? form;
133+
Guid recordId;
134+
Record? record;
135+
string submittedEmail;
136+
137+
if (Guid.TryParse(TempData["UmbracoFormSubmitted"]?.ToString(), out Guid formId) &&
138+
Guid.TryParse(TempData["Forms_Current_Record_id"]?.ToString(), out Guid recordId))
139+
{
140+
141+
form = _formService.Get(formId);
142+
143+
if (form != null && TempData["Forms_Current_Record_id"] != null)
144+
{
145+
Guid.TryParse(TempData["Forms_Current_Record_id"]?.ToString(), out recordId);
146+
147+
record = _recordStorage.GetRecordByUniqueId(recordId, form);
148+
149+
submittedEmail = record.GetRecordFieldByAlias("email")?.ValuesAsString();
150+
}
151+
}
152+
}
153+
```
154+

16/umbraco-cms/reference/routing/custom-controllers.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public class ProductListingPageController : Umbraco.Cms.Web.Common.Controllers.R
311311

312312
## Controller Injection
313313

314-
Injecting services into your controller constructors is possible with Umbraco's underlying dependency injection implementation. See [Services and Helpers](../../implementation/services/#custom-services-and-helpers) for more info on this.
314+
Injecting services into your controller constructors is possible with Umbraco's underlying dependency injection implementation. See [Services and Helpers](../../implementation/services/README.md#custom-services-and-helpers) for more info on this.
315315

316316
For example:
317317

@@ -346,14 +346,7 @@ public class RegisterSuperSiteServiceComposer : IUserComposer
346346
{
347347
public void Compose(IUmbracoBuilder builder)
348348
{
349-
public class RegisterSuperSiteServiceComposer : IUserComposer
350-
{
351-
public void Compose(IUmbracoBuilder builder)
352-
{
353-
builder.Services.AddUnique<IMadeUpProductService, MadeUpProductService>();
354-
355-
}
356-
}
349+
builder.Services.AddUnique<IMadeUpProductService, MadeUpProductService>();
357350
}
358351
}
359352
```

16/umbraco-forms/developer/working-with-data.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,43 @@ Sample script that is outputting comments using a Form created with the default
110110
}
111111
</ul>
112112
```
113+
114+
## Loading a Record From a Submitted Form
115+
When a form is submitted, the submitted form ID and the saved record ID are stored in the `TempData` so they can be referenced.
116+
117+
You can use the FormService and the RecordStorage to get the `Form` and `Record` objects.
118+
119+
Here is a sample code for retrieving a record in a view.
120+
121+
```
122+
@using Umbraco.Forms.Core.Models
123+
@using Umbraco.Forms.Core.Persistence.Dtos
124+
@using Umbraco.Forms.Core.Data.Storage
125+
@using Umbraco.Forms.Core.Services
126+
@inject IFormService _formService
127+
@inject IRecordStorage _recordStorage
128+
@inherits UmbracoViewPage
129+
@{
130+
Guid formId;
131+
Form? form;
132+
Guid recordId;
133+
Record? record;
134+
string submittedEmail;
135+
136+
if (Guid.TryParse(TempData["UmbracoFormSubmitted"]?.ToString(), out Guid formId) &&
137+
Guid.TryParse(TempData["Forms_Current_Record_id"]?.ToString(), out Guid recordId))
138+
{
139+
140+
form = _formService.Get(formId);
141+
142+
if (form != null && TempData["Forms_Current_Record_id"] != null)
143+
{
144+
Guid.TryParse(TempData["Forms_Current_Record_id"]?.ToString(), out recordId);
145+
146+
record = _recordStorage.GetRecordByUniqueId(recordId, form);
147+
148+
submittedEmail = record.GetRecordFieldByAlias("email")?.ValuesAsString();
149+
}
150+
}
151+
}
152+
```

16/umbraco-forms/editor/creating-a-form/conditional-logic.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,21 @@ When applying a condition to a page, effectively you are controlling the display
6161

6262
## Conditions for Dates
6363

64-
You can apply conditions to dates as well as strings. When you use the date picker field, you can set a condition if a submitted date is greater/less than a specific date.
64+
To use less-than or greater-than conditions on dates, you must change the date format.
65+
66+
By default, date is shown like `September 5, 2025`. This needs to change to a format only containing numbers: `09/05/2025`.
67+
68+
To change the default format setting for dates, follow the steps below:
69+
70+
1. Open the `appSettings.json` file.
71+
2. Change the `DatePickerFormat` value to `L` (the default is `LL`):
72+
73+
```json
74+
"Forms": {
75+
"FieldTypes": {
76+
"DatePicker": {
77+
"DatePickerFormat": "L"
78+
}
79+
}
80+
}
81+
```

16/umbraco-workflow/release-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Check the [Version Specific Upgrade Notes](upgrading/version-specific.md) articl
1616

1717
This section contains the release notes for Umbraco Workflow 16 including all changes for this version.
1818

19-
### 16.0.4 (September 15 2025)
19+
### 16.0.5 (September 15 2025)
2020
* Further fixes for approval group input sorting.
2121

2222
### [16.0.4](https://github.com/umbraco/Umbraco.Workflow.Issues/issues?q=is%3Aissue+is%3Aclosed+label%3Arelease%2F16.0.4) (September 10 2025)

0 commit comments

Comments
 (0)