Copied to clipboard

Flag this post as spam?

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


  • J 447 posts 864 karma points
    Mar 31, 2014 @ 12:32
    J
    0

    Save and retrieve contour form

    1. Is it possible to save a contour form when clicking to the next step?
    2. If the answer to Q1 is yes, then if the form can be saved - how? And is it possible to save it so the user can return back to it once the browser has been closed? i.e. by a hyperlink?

  • Dan 1288 posts 3921 karma points c-trib
    Mar 31, 2014 @ 12:50
    Dan
    0

    Hi,

    I believe Contour multi-part forms save as you go along, so it's partially covered. However, it's not possible to leave the form (i.e. close browser, start a new session) and resume where you left off, out of the box, but it's fairly straight forward to do it with a bit of custom code. See similar thread from a couple of weeks ago: http://our.umbraco.org/forum/umbraco-pro/contour/44630-Contour-Saving-a-multi-part-form-for-later-editing.

    Hope this helps...

    Dan

  • J 447 posts 864 karma points
    Apr 10, 2014 @ 17:25
    J
    0

    Thanks. When you say " You'll need to create a property on the member type - in this case it has an alias of 'additionalDataFormRecordId'." Im lost! Could you give me a bit more info on how to go about this please? Thanks again

  • Dan 1288 posts 3921 karma points c-trib
    Apr 10, 2014 @ 17:59
    Dan
    0

    Sure! What you're trying to do here is be able to save the id of a particular Contour form to a member, so that there's a relationship between a specific member and a specific Contour form. To do this you need some means of being able to save the Contour id to a member, so go to the members section and open up the member type you're wanting to use for the members who'll be using the form. The go to the 'Generic properties' tab and click to add a new property; give it a name, alias (in my example 'additionalDataFormRecordId') and a type of 'label'. That's it.

    This gives you a field on your member which can be used to store the contour form id (guid). By choosing 'label' as the type it just means that it can't be tampered with through the back-office, unlike if it was a 'text' field which would be editable. So now each member will have this field available in which to store the Contour form id, which you can then use to pull the form back out into editing mode so that user can resume their form.

  • J 447 posts 864 karma points
    Apr 11, 2014 @ 14:38
    J
    0

    Thanks Dan, Im still slightly lost :(.

    This is what i have done,

    Create the form and then go into Advanced mode in Workflows under Contour. Under When the form has been PartiallySubmitted i Add a workflow and select Save progress of form to member property and save.

    Umbraco Site >Members > Right click Member Types and create a new entry called SaveForm > Generic Properties > Add new property, enter additionalDataFormRecordId of type Label and save it.

    Open the form in preview mode, enter some data, press next. Go into Contour > Entries and i dont see anything with additionalDataFormRecordId with any guid against it?

    And the second part of my question would be how could i let the user know how to return back to this form/section?

    Many thanks

  • Dan 1288 posts 3921 karma points c-trib
    Apr 11, 2014 @ 14:53
    Dan
    0

    Hi,

    I'm not working on this right now so don't have the code to hand, but I don't think the form will be visible in the Contour 'entries' interface until it's completely finished and the last step has been submitted, so that would explain that one - it's expected behaviour. But so long as you're submitted at least one step of the form, the entry should be in the database and will have a unique reference (Guid).

    As to how to check whether it's saving the partially-completed form to the member, try going to the member you were logged in as whilst submitting the part of the form (in the member section of Umbraco, locate the member and look at their properties). Do you see anything in the 'additionalDataFormRecordId' field? If so, great, then that means the partially submitted form entry guid has saved correctly to your member; if not, then there's something not right, in which case check these things:

    1. That you're actually logged in as a member (not an umbraco back-office user, but a front-end website member) before entering data into the form on the website.

    2. Check that the member you're logged in as, belongs to the correct member type (the member type which contains the custom property 'additionalDataFormRecordId'). So in your case the member should be of the 'SaveForm' member type.

    3. Ensure that you're completing (submitting) at least one step of the form. The workflow will only be triggered when you submit a step of the form.

    4. Try setting a break-point in the custom workflow to ensure that it's being hit.

    If the form record id is being correctly saved to the member property then you should be able to give the member a link to resume their form, by pulling out the record id from their member properties and appending it to the original URL of the page which contains the form, as a querystring. So, if your form is at: http://example.com/form-page/ then to resume a particular form submission the member would have to visit: http://example.com/form-page/?recordGuid=e2650e4d-3444-4dc1-9f45-d91257b4f77f - where 'recordGuid' is the value stored against the 'additionalDataFormRecordId' property of that member.

    I know there's a lot of terminology here, but I can't think of a more accurate way to explain it. Let me know if it still doesn't make sense and I'll try again. :)

  • J 447 posts 864 karma points
    Apr 11, 2014 @ 15:20
    J
    0

    Dan - thank you (again). I think the first call would be to distinguish if i am logged in as a member - which i think im not. What happens is i have a public site and i navigate to a page and start filling in the form. Since this page is public it means anyone can arrive and fill this form but in the instance they click next and want to resume at a later stage is where i would like to give them a URL to return back to

  • Dan 1288 posts 3921 karma points c-trib
    Apr 11, 2014 @ 15:34
    Dan
    0

    You basically need some way to store the form record guid to the website visitor. In my example in the other thread I'm only working with members (logged-in website visitors) so it makes sense to save this value as a property on the member. If you're not dealing with members then you'll probably need to set it as a cookie. It should still work fine, but obviously there's the risk that people can delete their cookies, in which case they won't be able to resume the form.

    In terms of redirecting users to complete the form if it's saved as a cookie, that should be relatively simple - just detect on your webpage whether the visitor has a value for a particular cookie, and if so, redirect them back to the form page with that value as the 'recordGuid' parameter.

    I think the only other consideration is that you might want to create another custom workflow on completion of the form to delete the cookie, so that when they next visit the site they're not directed to the form completion page.

  • J 447 posts 864 karma points
    Apr 11, 2014 @ 17:00
    J
    0

    Im just thinking here but i noticed when i click next on a form with multiple steps it save to the entries section in Contour which also captures an email address from the user, so i could send them an email with the link to the form when the click next on the first page - Is it possible to use approach if yes then i assume i get the recordID using this bit of code

    var formRecordId = record.Id;
    

    but then all i need to do is preappend the record ID with the URL to take them to the form? 

  • Dan 1288 posts 3921 karma points c-trib
    Apr 11, 2014 @ 17:10
    Dan
    0

    Yes, that would work.

Please Sign in or register to post replies

Write your reply to:

Draft