Jeff Sullivan
going with the flow Posts:39
|
12-13-2010 05:53 PM |
|
Hi, I'd like to see an example of a dynamic form that does a few things... wondering if there are relevant examples floating around. 1. We'd like to store the data in a specific table so other tools can access the data. Is it required that we build a custom table, or is there a way to simply tell DF "store this data in a table of your creation, but named FOO?" 2. We'd like to store the userID (integer, not the changeable username) with the data collected so we can link it to the (registered) user. We created a hidden field, but can't see how to stuff the DNN user ID value in there -- is it a defined token? We can't find a list of them in the user guide. 3. We're going to pass a unique completion ID forward to the next page, but we need that stored with the data collected so we can retriev it on the subsequent page (some of the data can't pass thru Qstring). Thanks! |
|
|
|
|
Jeff Sullivan
going with the flow Posts:39
|
12-14-2010 07:33 AM |
|
Okay, for those who might be interested, here's what we learned: 1. Clicking the "Pass unique completionID?" setting in Module Settings->General Settings results in a session variable called "UniqueCompletionID" being set. To access it on subsequent pages, you must create a hidden field called UniqueCompletionID and check the Advanced setting "Retrieve values from session variable for this question". HOWEVER, we could not use this value in a SQL binding of other fields on the new form (e.g., "Select Foo as DefaultValue from Bar where uid = $(UniqueCompletionID)") for some reason; this ID always came thru as 000-000-000-000 in debug mode when we tried. 2. The data stored by default in the DynamicForms_QuestionResponse table does store the numeric UserID of the person answering the questions, so we could cobble together a self-joined query to extract all of the answers we wanted from that table. 3. The UniqueCompletionID is stored in DynamicForms_QuestionResponse as the UniqueResponseID field, so we could recover the data with that. |
|
|
|
|
Chuck
river guide Posts:157
|
12-16-2010 06:05 AM |
|
HOWEVER, we could not use this value in a SQL binding of other fields on the new form (e.g., "Select Foo as DefaultValue from Bar where uid = $(UniqueCompletionID)") for some reason; this ID always came thru as 000-000-000-000 in debug mode when we tried. Jeff, I would create another question that is a hiddenfield called UniqueCompletionID, which retrieves from the session variable $(UniqueCompletionID) Then try your SELECT statement to see if it captures your values. Also, another option, if its doable in your setup, is to use the Initial SQL Rendering/Bind (Module Configuration) setup to output your form fields values by using a stored procedure. As for the UserID, you can capture that value as a tokenID of $(UserID) -Chuck |
|
|
|
|
Jeff Sullivan
going with the flow Posts:39
|
12-16-2010 07:28 AM |
|
Chuck, we are already creating a hidden field called UniqueCompletionID. It is getting its values from the session variable of the same name, but when we use $(UniqueCompletionID) in SQL, the 000-000 value shows up, even though we can see an actual GUID in the hidden field. |
|
|
|
|
Chuck
river guide Posts:157
|
|
Ryan Bakerink
river guide Posts:1900
|
12-16-2010 01:32 PM |
|
Hello Gizmoboy, If you need help with this please let me know, although Demonstration 31 covers all of the content needed to know in order to accomplish this. Thanks for including the reference Chuck. -Ryan |
|
|
|
|
M.Pratt
wading in the water Posts:28
|
11-05-2012 11:38 AM |
|
Jeff. FYI: The scenario described above now works fine in version 4.10.4. I have a field called UID with a query Select '$(UniqueCompletionID)' as DefaultValue It is able to read that session variable and pull it in. The exact same setup does not work in 3.4 (on our test server), it just shows 0000-0000 etc. I am not sure which version fixed it, but it's there now. -MP |
|
"Badges?....We don't need no stinking badges!" |
|
|
Ryan Bakerink
river guide Posts:1900
|
11-05-2012 12:52 PM |
|
Yes I've experienced this as well. I prefer to use this: Select Cast(newId() as nvarchar(200)) As DefaultValue I've never experienced 000-000000-00000-00000-00000-000 as the value of the query above. -Ryan
|
|
|
|
|
dmouse
skipping stones Posts:8
|
02-21-2013 05:36 PM |
|
Hi There I would like to know why the $(UniqueCompletionID) is not available as a token in the View Form Results token list? We have managed to get it into the querystring http://kotahi.maf.govt.nz/do/tools-...0a8a5eb2e3but how would we then reference the value in the template? any help is appreciated ta Denis |
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
02-22-2013 10:59 AM |
|
Hello Dennis, $(UniqueCompletionID) is simply a value that most users/ form admins have no idea exists. This is why, by default, UniqueCompletionID value isn't displayed in View Form Results. If you need to show this value, then I would recommend adding a hidden field on your Dynamic Form with a SQL Default value of: Select '$(UniqueCompletionID)' As DefaultValue You should begin seeing this label and value in View Form Results from here on out. Don't forget that you can also manage the View Form Results template. There are limitations to how much layout diversity you can really achieve with View Form Results, but if that becomes an issue, I would recommend trying Dynamic Views out. Download Free Trial Version of Dynamic Views: http://www.datasprings.com/products...iews-trial Please let me know if you have any questions. Thanks, Ryan |
|
|
|
|
dmouse
skipping stones Posts:8
|
02-24-2013 10:18 AM |
|
../trevel-approval?URID=00000000-0000-0000-0000-000000000000 so does that mean we have to upgrade the module? |
|
|
|
|
dmouse
skipping stones Posts:8
|
02-24-2013 01:22 PM |
|
I guess the other question is when is this ID created - On form load or form submission?
If it is the later then would we not need to populate the hidden ID field with something like
UPDATE DynamicForms_QuestionResponse SET response = $(UniqueCompletionID) where dynamicQuestionID = 'n' AND UniqueResponseID = $(UniqueCompletionID)
This is assuming that the token $(UniqueCompletionID) and the DB field UniqueResponseID are one and the same? |
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
02-25-2013 04:51 AM |
|
Hello dmouse, Sounds like a buggy behavior with UniqueCompletionID if the value is displayed as 00000000-0000-0000-0000-000000000000 when passing as Querystring. What DNN version and DF version are you running? You may want to make sure you're operating on DF 4.1.4(latest DF version). UniqueCompletionID is created on page load. So this token is available to you on Page Load and on Page Unload. I believe that the UniqueCompletionID value maps to the DynamicForms_QuestionResponse table's column named "UniqueResponseID". Please let us know if you have any questions. Thanks, Ryan |
|
|
|
|