Answers.Body: <p>I believe this has been implemented now so that there is a setting on the Event section of the webform's civicrm tab so that you can 'allow events to be autoloaded from URL'</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-01T08:57:56.213Z
Answers.LastActivityDate: 2020-10-27T02:59:16.237Z
Answers.LastEditDate: 2020-10-27T02:59:16.237Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>The answer is (I hope) 'yes' but I can't get it to work - see <a href="https://civicrm.stackexchange.com/questions/6706">How to select a default event in webform where event is repeating</a>
   I'm pretty sure the Views side is working as it generated a url that when clicked gave me the webform with the correct event selected (this is on a Views screen).  But when I run the webform I get '- None -' displayed in the event list box. Yes, I have checked "Allow events to be autoloaded from URL checked."  Code is at the latest level - I went back to Webform 7.4.9 and Webform 7.4.11 to see if there had been a regression but no change.<br>
  So now I'm wondering if this is a bug in Webform-CiviCRM?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-28T19:24:42.733Z
Comments.Text: What exactly is the url argument you are giving it?
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-28T19:27:47.220Z
Comments.Text: The url in rewrite section of the global custom text field is node/27?event1=[id]
  Which doesn't square with the help in webform which shows 2 event ids (but that didn't work either). This is where I am registering all contacts for the same event, although there is only one contact in this case.
Comments.UserDisplayName: Andy Clark
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-28T19:50:22.497Z
Comments.Text: And is [id] one of the available events in the select field? It won't pick something that's not there.
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-28T19:56:07.173Z
Comments.Text: Not sure what you mean, but I just clicked on the first of the listed events in the Views screen and it gave me this url https://www.dcm-admin.org.uk/node/25?event1=163   - this is the correct event.  But when I run the webform it doesn't pick this or any event.
Comments.UserDisplayName: Andy Clark
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-28T20:00:20.917Z
Comments.Text: I mean, have you added a "select" field to the webform containing that event as one of the options?
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-28T20:03:51.497Z
Comments.Text: Yes, it's a list box, with 'Live Options' selected.  It lists all the events (over 100) but doesn't select one, just shows '- None - '
Comments.UserDisplayName: Andy Clark
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-28T20:13:09.010Z
Comments.Text: I just tested it on my local and the autofill does work. Ensure that you have "register all contacts for the same event(s)" as that's the format you're using. If you are using "register each contact separately" then the link needs to be node/27?c1event1=[id]
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-28T20:15:15.227Z
Comments.Text: I have that option checked,  and my url is correct but no dice! Any other suggestions?
Comments.UserDisplayName: Andy Clark
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-29T17:17:56.320Z
Comments.Text: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/32280/discussion-between-andy-clark-and-coleman).
Comments.UserDisplayName: Andy Clark
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-04T18:35:45.550Z
Comments.Text: I found a workaround for this problem - set a default event (in the past), and have 'Show Past Events' set as 'None'.  Then the 'next' event will be selected rather than none.  So maybe no need for the Views stuff, which I could not get working.
Comments.UserDisplayName: Andy Clark
Tags: <webform-civicrm><drupal-views>
Title: Can webform-civicrm pre-select an event using Drupal Views?
ThreadText: # Can webform-civicrm pre-select an event using Drupal Views?
  
  (Asked by: username_0 on 2015-11-28)
  
  The answer is (I hope) 'yes' but I can't get it to work - see [How to select a default event in webform where event is repeating](https://civicrm.stackexchange.com/questions/6706)
  I'm pretty sure the Views side is working as it generated a url that when clicked gave me the webform with the correct event selected (this is on a Views screen). But when I run the webform I get '- None -' displayed in the event list box. Yes, I have checked "Allow events to be autoloaded from URL checked." Code is at the latest level - I went back to Webform 7.4.9 and Webform 7.4.11 to see if there had been a regression but no change.  
  So now I'm wondering if this is a bug in Webform-CiviCRM?
  
  **Tags:** webform-civicrm, drupal-views
  
  > **Comments:**
  > **username_1**: What exactly is the url argument you are giving it?  
  > **username_0**: The url in rewrite section of the global custom text field is node/27?event1=[id] Which doesn't square with the help in webform which shows 2 event ids (but that didn't work either). This is where I am registering all contacts for the same event, although there is only one contact in this case.  
  > **username_1**: And is [id] one of the available events in the select field? It won't pick something that's not there.  
  > **username_0**: Not sure what you mean, but I just clicked on the first of the listed events in the Views screen and it gave me this url https://www.dcm-admin.org.uk/node/25?event1=163   - this is the correct event.  But when I run the webform it doesn't pick this or any event.  
  > **username_1**: I mean, have you added a "select" field to the webform containing that event as one of the options?  
  > **username_0**: Yes, it's a list box, with 'Live Options' selected.  It lists all the events (over 100) but doesn't select one, just shows '- None - '  
  > **username_1**: I just tested it on my local and the autofill does work. Ensure that you have "register all contacts for the same event(s)" as that's the format you're using. If you are using "register each contact separately" then the link needs to be node/27?c1event1=[id]  
  > **username_0**: I have that option checked,  and my url is correct but no dice! Any other suggestions?  
  > **username_0**: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/32280/discussion-between-username_0-and-username_1).  
  > **username_0**: I found a workaround for this problem - set a default event (in the past), and have 'Show Past Events' set as 'None'.  Then the 'next' event will be selected rather than none.  So maybe no need for the Views stuff, which I could not get working.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-09-01. Score: 0
  
  I believe this has been implemented now so that there is a setting on the Event section of the webform's civicrm tab so that you can 'allow events to be autoloaded from URL'
  
  
  ---
  
  