Redirect user to certain URL after filling form?

302 views
Skip to first unread message

El Piqo

unread,
Mar 24, 2015, 12:25:21 PM3/24/15
to enketo...@googlegroups.com
Hi, 

Is this possible? I am not able to see such setting.

Best ,
Piqo

Martijn van de Rijdt

unread,
Mar 24, 2015, 12:41:06 PM3/24/15
to enketo...@googlegroups.com
Hi Piqo,

Single-submission views with a redirect option are planned/designed and high on (my) list of desired features, but not yet implemented. Will also require support from a sponsor to implement.


Cheers,
Martijn



--
You received this message because you are subscribed to the Google Groups "enketo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enketo-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
Revolutionizing data collection since 2012.

Enketo    |    LinkedIn    |    GitHub    |    Twitter    |    Blog

El Piqo

unread,
Mar 24, 2015, 3:47:28 PM3/24/15
to enketo...@googlegroups.com
Hi Martijn, 

Single-submission will be indeed very useful, but in my case I needed a simple redirect (nothing fancy, all users get redirected somewhere), no security involved, simply from the usability standpoint. 
A returnURL variable somewhere would have been nice. (It is one, but I think it is used for the External Authentication)

As a quick workaround for my case I was thinking to put some redirect function in a successful submission that redirects to a URL that is set in the config.json file (if set, otherwise dont redirect) somewhere around:

What do you think? 

Best, 
piqo

Martijn van de Rijdt

unread,
Mar 24, 2015, 4:01:31 PM3/24/15
to enketo...@googlegroups.com
Hi Piqo,

Yes, this would work, I think. Make sure to also copy the 'redirect online-only upon submission' config item here: https://github.com/kobotoolbox/enketo-express/blob/master/app/models/config-model.js#L33. This way it will be available on the client in the settings object.

Depending on how the user reaches the webform, another approach would be to open the form in a modal with an iframe and listen for the submission success event as explained here: https://github.com/kobotoolbox/enketo-express/blob/master/APIv2.md#postmessage.

It probably makes sense to have a single submission view without protection. So the protection should become an optional parameter.

Cheers,
Martijn

El Piqo

unread,
Mar 25, 2015, 5:50:48 PM3/25/15
to enketo...@googlegroups.com
You are awesome. Thanks a lot. I went with the second method and it worked. 

piqo

Martijn van de Rijdt

unread,
Mar 25, 2015, 5:57:50 PM3/25/15
to enketo...@googlegroups.com
Great to hear that :)

This method is pretty powerful. It was developed to allow enketo forms to be easily used on a map to enter data for a specific location, while remaining in full control. 

Ed Robinson

unread,
Aug 8, 2016, 4:22:56 AM8/8/16
to enketo-users
Hi, I'm getting a 404 on that link, is there another URL I can use?
Thanks!

Martijn van de Rijdt

unread,
Aug 8, 2016, 11:18:08 AM8/8/16
to enketo...@googlegroups.com
Hi Ed,


I'm slowly working on a proper site with documentation for these kind of features.

Cheers,

To unsubscribe from this group and stop receiving emails from it, send an email to enketo-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Martijn van de Rijdt

unread,
Sep 23, 2016, 12:45:19 PM9/23/16
to enketo-users
We now have a bunch of special single submission survey features that can redirect after submission, and optionally protect against multiple submissions!

Edwin Matlaba

unread,
Oct 18, 2019, 9:38:15 AM10/18/19
to enketo-users
Hi Martin,

I'm following this thread and I would like to know what needs to be edited in the "config.json" to achieve the redirection after submission?


On Friday, September 23, 2016 at 6:45:19 PM UTC+2, Martijn van de Rijdt wrote:
We now have a bunch of special single submission survey features that can redirect after submission, and optionally protect against multiple submissions!

http://blog.enketo.org/single-submission-surveys/

On Monday, August 8, 2016 at 9:18:08 AM UTC-6, Martijn van de Rijdt wrote:
Hi Ed,


I'm slowly working on a proper site with documentation for these kind of features.

Cheers,
To unsubscribe from this group and stop receiving emails from it, send an email to enketo...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Martijn van de Rijdt

unread,
Oct 18, 2019, 11:17:16 AM10/18/19
to enketo...@googlegroups.com
Hi Edwin,

The redirect functionality does not involve config.json. It can (only) be set via the API, for any endpoint that supports the return_url parameter:  https://apidocs.enketo.org/

Cheers,
Martijn



--
Pushing data since 2012.

Enketo    |    LinkedIn    |    GitHub    |    Twitter    |    Blog

Edwin Matlaba

unread,
Oct 18, 2019, 11:32:01 AM10/18/19
to enketo...@googlegroups.com
Thanks Martin,

I followed the API Doc but I'm facing error 405-Not allowed; that's why I thought about the config.json, so do you have a hint about the error 405?


Martijn van de Rijdt

unread,
Oct 18, 2019, 11:55:16 AM10/18/19
to enketo...@googlegroups.com
Hi Edwin, 

A 405 means the endpoint is not supported or unsupported method (other than GET or POST) is used. What's the URL you are sending your request to?

Edwin Matlaba

unread,
Oct 18, 2019, 5:42:30 PM10/18/19
to enketo-users
Hi Martin,

Thanks a lot for the support; YOU ROCK!

Cheers.
To unsubscribe from this group and stop receiving emails from it, send an email to enketo...@googlegroups.com.


--
Pushing data since 2012.

Enketo    |    LinkedIn    |    GitHub    |    Twitter    |    Blog

-- 
Revolutionizing data collection since 2012.

Enketo    |    LinkedIn    |    GitHub    |    Twitter    |    Blog

--
You received this message because you are subscribed to the Google Groups "enketo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enketo...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "enketo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enketo...@googlegroups.com.

Henry Tebajjukira

unread,
Oct 21, 2019, 6:10:55 AM10/21/19
to enketo-users
Hi Edwin,

I have gone through this before.

Consider using postman(https://www.getpostman.com) for testing your endpoint.

Best,
Henry

Edwin Matlaba

unread,
Oct 21, 2019, 7:52:33 AM10/21/19
to enketo-users
Hi Henry,

Thanks a lot.

Kind regards.

Musinguzi Polycarp

unread,
Feb 24, 2021, 1:04:32 AM2/24/21
to enketo-users
Hello people,

Thank you for the good work you're doing.
I am new to enketo. I purchased a plan and linked my ODK Aggregate account to it. However, I need the user to be redirected to a thank you page after filling in the form to prevent them from filling another. I have read widely, about the Single Submission Surveys but can't seem to get it enables on my forms. How do I enable this? See below the page I get after submitting a form. Kindly assist. 2021-02-24.pngC

Martijn van de Rijdt

unread,
Feb 24, 2021, 11:26:30 AM2/24/21
to enketo...@googlegroups.com
Hi Musinguzi,

The easiest is to not use Aggregate but use a modern solution that has support for this Enketo feature built in. E.g. ODK Central, the replacement of ODK Aggregate, has this built-in I believe (though not sure if you can provide a URL to redirect to).

To use this with Aggregate, you'd have to manually make an API call to Enketo using a console and curl (or an app such as Postman). 

Cheers,
Martijn

Reply all
Reply to author
Forward
0 new messages