CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Pre-filling a profile sign-up page with non-civiCRM data?
Pages: [1]

Author Topic: Pre-filling a profile sign-up page with non-civiCRM data?  (Read 1316 times)

Stautz

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.4.1
  • CMS version: 7.23
  • PHP version: 5.3.3
Pre-filling a profile sign-up page with non-civiCRM data?
January 22, 2013, 01:13:36 am
I am trying to do a mailing list sign up form, but I would like some of the fields to be pre-filled with data from another form.
The flow would be something like this:
1. User enters email and maybe other data in a form on the front page.
2. When submit is clicked, the user is then taken to the profile page with the data from the previous form already pre-filled.

How would I do this? If it is even possible to do?

Tony Horrocks

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 7
    • Fabriko Limited
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7
Re: Pre-filling a profile sign-up page with non-civiCRM data?
January 22, 2013, 03:13:44 am
You can try using Drupal Webform CiviCRM module.

Create a webform with CiviCRM fields for the data you wish to capture in step one. These can and CiviCRM contact fields. Make sure that you tick contact ID and checksum on the CiviCRM form part of the webform (sorry, you'll just have to explore how Webform CiviCRM works!)

Then in CiviCRM, create the profile you want users to go to after completing step one. Make a note of the ID.

Back in CiviCRM webform, go to webform settings and make the redirection page a custom link, using your profile ID and the user ID checksum.

Now when the user completes step 1 they get send to step 2 with all the fields they filled in in step 1 populated.

You need to spend a bit of time using Webform CiviCRM in Drupal but it works very well.
Tony Horrocks
Author of the CiviCRM CookBook https://www.packtpub.com/web-development/civicrm-cookbook

Stautz

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.4.1
  • CMS version: 7.23
  • PHP version: 5.3.3
Re: Pre-filling a profile sign-up page with non-civiCRM data?
January 23, 2013, 02:23:05 am
Thank you for the reply, I will try it out! :-)

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Pre-filling a profile sign-up page with non-civiCRM data?
January 24, 2013, 01:56:45 pm
If you go the webform route you'll probably find that you don't need the profile at all. The webform can do it all - signing them up for the newsletter and collecting whatever other information you want. You could do this all on the same form, or on a single multipage webform, or on two separate forms linked together by the above mentioned redirect and checksum trick.
I recommend reading the instructions for webform_civicrm: http://drupal.org/node/1615380
Try asking your question on the new CiviCRM help site.

Stautz

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.4.1
  • CMS version: 7.23
  • PHP version: 5.3.3
Re: Pre-filling a profile sign-up page with non-civiCRM data?
March 21, 2013, 05:09:44 am
I finally got around to implementing this. I used a simple HTML form to send the variable from the input field to the webform, so the specific field is pre-filled - and it works perfectly. So thank you for all the help.

Is there any way to have the webform check if a value (in this case an email) exists in the system already, before submitting the form?


Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Pre-filling a profile sign-up page with non-civiCRM data?
March 21, 2013, 10:18:28 am
No but it will check to see if that email already exists after submitting the form (assuming you have your default strict dedupe rule setup for that) and it will update the existing contact rather than create.

Edit: well this is drupal, so anything is possible. You could code a simple validation hook for this that did a lookup in the civicrm db.
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Pre-filling a profile sign-up page with non-civiCRM data?

This forum was archived on 2017-11-26.