Copied to clipboard

Flag this post as spam?

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


  • MickTemp 27 posts 109 karma points
    Mar 05, 2019 @ 04:22
    MickTemp
    0

    Getting a form record on thank you page

    Once an Umbraco Form submits and redirects to a thank you page, how on earth does one go about accessing the record that was just submitted?

    TempData contains two keys - UmbracoForms which I think is a list of form GUIDs and Forms_Current_Record_id which contains the current record's GUID. The last one is great but how do I access it? Can't find anything in the docs, am I blind.

    P.S there was this unresolved thread as well with no solution. Talked of custom workflows though, so was unsure if I should bump it.

    EDIT: And apparently umbracoformsform used to also be a TempData key containing the current form but apparently is no longer there.

  • Ultradata 16 posts 108 karma points
    Mar 05, 2019 @ 05:23
    Ultradata
    0

    Hi,

    Sorry if I'm missing the basis of your question as I'm not a tech person.

    But... if you are just trying to view the submitted form values, within the Form ribbon item, click on the arrow to the left of the form name. The Entries folder will then appear.

  • Matthew Wise 271 posts 1373 karma points MVP 4x c-trib
    Mar 05, 2019 @ 07:21
    Matthew Wise
    0

    Hi,

    I can't remember the name space but you use the RecordService

    Hope you find it Matt

  • Gerty Engrie 130 posts 489 karma points c-trib
    Jul 18, 2019 @ 11:57
    Gerty Engrie
    0

    Hi,

    The Recordservice is now ( umb v8.1 / forms v8.1.1) an interface. MickTemp did you ever succeed at displaying the data on the thank you page without maken a custom workflow?

    thanks,

    Gerty

  • MickTemp 27 posts 109 karma points
    Jul 25, 2019 @ 00:50
    MickTemp
    0

    Hi Gerty,

    Yes, I ended up doing something like this in a view for Umbraco 7, given a known form Guid. Not proud of it but I ran out of time.

    I haven't touched Umbraco 8 yet so not sure how to adapt this if RecordService is now an interface. We also don't use Umbraco Forms anymore after this, sorry I can't be of more help.

    Guid formGuid = new Guid("xxxxxx-xxxx-xxxx-xxxx-xxxxxxx");
    Record formRecord;
    
    using (var fs = new FormStorage())
    {
        var form = fs.GetForm(formGuid);
    
        using (RecordStorage storage = new RecordStorage())
        {
            formRecord = storage.GetAllRecords(form).Where(r => r.UniqueId.ToString() == TempData["Forms_Current_Record_id"]).FirstOrDefault();
        }
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft