Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon Hewitt 65 posts 126 karma points
    Jul 03, 2014 @ 14:15
    Simon Hewitt
    0

    From RecordId to Form Name

    I'd like to use a bit of razor on the form thank you page to customize the message to include the form name so multiple forms can reuse the same thank you page.

    Is it possible to get the form name from the recordid I have available at the thank you page. From a quick look it looks like I have the forms GUID but nothing else and I cant find anything in the documentation about retrieving form information.

    Any clues appreciated.

    Thanks Simon

  • Simon Hewitt 65 posts 126 karma points
    Jul 04, 2014 @ 16:32
    Simon Hewitt
    0

    For reference should anyone else need this I used the following:

    var recordId = Request.QueryString["recordid"];
    
    if (!string.IsNullOrEmpty(recordId))
    {
        using (var fs = new FormStorage())
        {
            Form f = fs.GetFormFromRecordId(new Guid(recordId));
            @:Form submitted: @f.Name
        }
    }
    

    You just need the following using statements to make this happy.

    @using Umbraco.Forms.Data.Storage

    @using Umbraco.Forms.Core

Please Sign in or register to post replies

Write your reply to:

Draft