Copied to clipboard

Flag this post as spam?

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


  • LeaTark 22 posts 123 karma points
    Sep 06, 2019 @ 09:20
    LeaTark
    0

    Form Name in v3

    I used to get the form name like this in v2

    var pickedForm = Model.Content.GetPropertyValue<ConfiguredFormInfo>("myFormPicker");
    var vm = formulate.api.Rendering.GetFormViewModel(pickedForm.FormId, pickedForm.LayoutId,
        pickedForm.TemplateId,
        // Include this parameter in Formulate 0.3.7 or greater.
        Model.Content);
    
    var formName = vm.FormDefinition.Name;
    

    How can I get it in v3?

    Thank you

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Sep 20, 2019 @ 21:44
    Nicholas Westby
    0

    Sorry for the delay (missed this one somehow).

    This might help to server as a point of reference: https://github.com/rhythmagency/formulate/blob/3004d968b4cc67f9663f6567c0babe9a08a7d41d/src/formulate.api/Controllers/FormulateRenderingController.cs

    You'll want to inject an instance of IDefinitionHelper into your controller, then save the instance (e.g., to a property).

    Once you have an instance, you can call something like this:

    var formName = DefinitionHelper.GetFormDefinition(pickedForm.FormId).Name;
    

    I haven't tried that, but I feel like that would work.

  • Syed 4 posts 73 karma points
    Feb 05, 2020 @ 12:12
    Syed
    0

    Can you please elaborate this step? I can't able to access formulate form in Umbraco 8.4.

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Feb 06, 2020 @ 16:49
    Nicholas Westby
    0

    Not sure what you mean by "I can't able to access formulate form in Umbraco 8.4".

Please Sign in or register to post replies

Write your reply to:

Draft