Umbraco Forms is an add-on for Umbraco CMS that allows you to easily create forms and link them to your content pages. After the form submissions, you can redirect your web users to a "thank you" page using the built-in "Submit message / Go to page" workflow. However, what if you want to redirect to a page dynamically based on the data submitted by the end user? Custom workflow to redirect One of the best solutions is to create a custom Umbraco Forms workflow based on requirements. For Umbraco v13+ websites, rather than using the HttpContext to redirect, which won't work out of the box for your custom workflow, you should use the WorkflowExecutionContext to set the GoToPageOnSubmit property of your form, like this. context . Form . GoToPageOnSubmit = goToPage . Id ; It is as simple as this. You can now do your tests and dynamically redirect your users to the next page after the form submissions. Full code using ProjectName . Website . Core . FormExtension...
How to resolve "InvalidOperationException: Cannot resolve 'ProjectName.SendEmailCustomUmbracoWorkflow' from root provider because it requires scoped service 'ProjectName.ICustomServiceName'"
When you access a custom service from within your Custom Umbraco Workflow or a similar environment, you may encounter an "Invalid Operation Exception." This error typically occurs because you are attempting to use a scoped service within a singleton context. Solution If you need to use a scoped service within a singleton, inject IServiceScopeFactory into the singleton. Then, create a scope to pull out your context when needed. using ProjectName . Microsites . Cms . DataAccess . Constants ; using ProjectName . Web . Services . Interfaces ; using Newtonsoft . Json . Linq ; using Umbraco . Forms . Core ; using Umbraco . Forms . Core . Attributes ; using Umbraco . Forms . Core . Enums ; using Umbraco . Forms . Core . Persistence . Dtos ; namespace ProjectName . Web . UI . Workflows { public class CrmFieldMapper : WorkflowType { private readonly ILogger < CrmFieldMapper > _logger; private ...