Copied to clipboard

Flag this post as spam?

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


  • Roy Berris 89 posts 578 karma points c-trib
    Apr 14, 2022 @ 09:07
    Roy Berris
    1

    UmbracoForms - Approve entry programmatically

    Hi,

    I have set post moderation for my form. How do I approve a entry programmatically? This will happen from a web hook.

  • Damien Holley 181 posts 542 karma points
    Jun 06, 2022 @ 04:57
    Damien Holley
    0

    +1 to this

  • Roy Berris 89 posts 578 karma points c-trib
    Jun 07, 2022 @ 11:05
    Roy Berris
    0

    Hi, I did figure this out. Forgot to update my question. See below!

  • Roy Berris 89 posts 578 karma points c-trib
    Jun 07, 2022 @ 11:04
    Roy Berris
    100

    First you need to get the Form from the IFormService.

    var form = _formService.Get("formId");
    

    Then you can use the IRecordStorage to get a Record by ID. You'll also need to parse the form.

    var record = _recordStorage.Get("recordId", form);
    

    And using the IRecordService you can approve records.

    _recordService.Approve(record, form);
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies