<p>As of Sprout Forms 0.8.4 this is not possible.  It is on our list to allow more customization over the form entries and how they are output on the front end so this will be possible in the future.  If you'd like us to prioritize this functionality, drop us a note and we're happy to have that conversation.</p>

<p>If you wish to save a Craft Entry after the Form Entry is saved, you're using the right Event above.  One thing you will want to be careful of is that the Sprout Forms <code>$entry</code> value is a SproutForms_EntryModel and the variable you need to pass to the <code>craft()-&gt;entries-&gt;saveEntry($entry)</code> method is a Craft EntryModel.</p>

<p>To do this you'll need some code to hand off the field values on the Form Entry to the field values on the Craft Entry:</p>

<pre><code>public function init() {

    // Support Sprout Forms plugin
    craft()-&gt;on('sproutForms.saveEntry', function(Event $event) {

        // SproutForms_EntryModel
        $formEntry = $event-&gt;params['entry'];

        // Craft EntryModel
        $craftEntry = new EntryModel;

        // Map your Form field values to the Entry field values
        $craftEntry-&gt;fieldName = $formEntry-&gt;fieldName;

        craft()-&gt;entries-&gt;saveEntry($craftEntry);
    });

}
</code></pre>

<p>That said, this method feels pretty messy to me.  Duplicating data is a great way to create great pains for yourself down the road. If you're set on doing this on your own, I'd recommend to create a custom plugin with and a variable that queries the Sprout Forms data how you'd like.</p>

<pre><code>{% set userFormSubmissions = craft.myCustomPlugin.sproutFormsQuery(userId) %}
</code></pre>

<p>When Sprout Forms gets around to adding this functionality, you can swap out your custom tag for the native Sprout Forms one and ditch the custom plugin.</p>

CC BY-SA 3.0
2015-01-21T05:56:44.920Z
Thanks Ben, indeed its not the best solution, and because I'm already going down a 'create-your-own-plugin' road, I think querying the forms directly is the best way to go. At least this gives me a good chance to get into plugin dev!
crawf
CC BY-SA 3.0
2015-01-21T05:59:18.910Z
Sounds good @crawf. That should be a nice little plugin to get started with. All you'll probably need is a PluginClass.php file, a variable that hands off responsibility to the service layer, and a service to do the querying.
Ben Parizek
CC BY-SA 3.0
2015-01-21T05:32:37.077Z
2015-01-21T05:32:37.077Z
Ben Parizek
<p>I'm basically wanting to manipulate user-submitted forms through the use of SproutForms. Basically, the user enters their form data, submits it, where it's recorded as a SproutForm entry. When that happens, I also want it to create an entry in a channel with the same data, so that I can freely use them in templates (showing users a list of their submissions).</p>

<p>All this would be simpler if SproutForms had some templating tags to output entries, but from looking through the plugin, I don't think thats possible.</p>

<p>Anyway, so an additional plugin could have something like this:</p>

<pre><code>public function init() {

    // Support Sprout Forms plugin
    craft()-&gt;on('sproutForms.saveEntry', function(Event $event) {
        $entry = $event-&gt;params['entry'];
        craft()-&gt;entries-&gt;saveEntry($entry);
    });

}
</code></pre>

<p>But that doesn't seem to work. Any ideas, or a better suggestion?</p>

<plugin-development><entries><plugin-sproutforms>
Saving entry from Sprout Forms into channel entry
# Saving entry from Sprout Forms into channel entry

(Asked by: username_0 on 2015-01-21)

I'm basically wanting to manipulate user-submitted forms through the use of SproutForms. Basically, the user enters their form data, submits it, where it's recorded as a SproutForm entry. When that happens, I also want it to create an entry in a channel with the same data, so that I can freely use them in templates (showing users a list of their submissions).
All this would be simpler if SproutForms had some templating tags to output entries, but from looking through the plugin, I don't think thats possible.
Anyway, so an additional plugin could have something like this:
public function init() {

    // Support Sprout Forms plugin
    craft()->on('sproutForms.saveEntry', function(Event $event) {
        $entry = $event->params['entry'];
        craft()->entries->saveEntry($entry);
    });

}

But that doesn't seem to work. Any ideas, or a better suggestion?

**Tags:** plugin-development, entries, plugin-sproutforms

---

## 1 answers

### Answer by username_1 on 2015-01-21. Score: 2 | Accepted answer

As of Sprout Forms 0.8.4 this is not possible.  It is on our list to allow more customization over the form entries and how they are output on the front end so this will be possible in the future.  If you'd like us to prioritize this functionality, drop us a note and we're happy to have that conversation.
If you wish to save a Craft Entry after the Form Entry is saved, you're using the right Event above.  One thing you will want to be careful of is that the Sprout Forms $entry value is a SproutForms_EntryModel and the variable you need to pass to the craft()->entries->saveEntry($entry) method is a Craft EntryModel.
To do this you'll need some code to hand off the field values on the Form Entry to the field values on the Craft Entry:
public function init() {

    // Support Sprout Forms plugin
    craft()->on('sproutForms.saveEntry', function(Event $event) {

        // SproutForms_EntryModel
        $formEntry = $event->params['entry'];

        // Craft EntryModel
        $craftEntry = new EntryModel;

        // Map your Form field values to the Entry field values
        $craftEntry->fieldName = $formEntry->fieldName;

        craft()->entries->saveEntry($craftEntry);
    });

}

That said, this method feels pretty messy to me.  Duplicating data is a great way to create great pains for yourself down the road. If you're set on doing this on your own, I'd recommend to create a custom plugin with and a variable that queries the Sprout Forms data how you'd like.
{% set userFormSubmissions = craft.myCustomPlugin.sproutFormsQuery(userId) %}

When Sprout Forms gets around to adding this functionality, you can swap out your custom tag for the native Sprout Forms one and ditch the custom plugin.

> **Comments:**
> **username_0**: Thanks Ben, indeed its not the best solution, and because I'm already going down a 'create-your-own-plugin' road, I think querying the forms directly is the best way to go. At least this gives me a good chance to get into plugin dev!  
> **username_1**: Sounds good @crawf. That should be a nice little plugin to get started with. All you'll probably need is a PluginClass.php file, a variable that hands off responsibility to the service layer, and a service to do the querying.  

---

