Hi all!
Over the last couple of years we have had customers run into problems from time to time if they are trying to use modules such as Dynamic User Directory or Interactive User Import/Export to import/showcase users within DotNetNuke and then they might have discovered that while using Dynamic Registration to register users, they were not always “linking” the Dynamic Registration fields to DotNetNuke Profile Property fields. In the future we might force each dynamic field to be mapped, or at the very lease make it a required field and have it be “very recommended” even, if one of the options is still not to map the field. Mapping each profile property is really the recommended approach… but, if you are running into problems because your site has been live and has important user information that has never been mapped, you might find this post useful.
If you need to retrofit your data that would have been stored in the DynamicRegistration_QuestionResponse table and not in the DNN User Profile property you can follow these steps below…
Step 1: Go back and map reach profile property correctly to your Dynamic Registration module. You can map profile property under Advanced Field Options when editing each Dynamic Registration field. Make note of the ModuleID for the module instance you are working with, you can find this within the main user-facing administration area of the module where it should list something like: mid:500.
Step 2: Find the matching profile property field for each dynamic field.
The first step in mapping existing user profile data is to find each DynamicQuestionID and then each DNN Profile Property ID that it should be mapped to. You can do this a few ways, but the quickest way is to probably run the query below under Host/SQL (you will want to replace 500 with the module ID # you collected in step 1 above).
Select DynamicQuestionID, Question, ShortFieldName, PRofPropID from {databaseOwner}[{objectQualifier}DynamicRegistration_Question] Where ModuleID = 500
This will bring in a few fields that you will need to make note of (maybe open up notepad or excel to keep track of what you will need for the next step). The most important columns from the query above are the “DynamicQuestionID” and “ProfPropID”. You can use the other columns such as Question and ShortFieldName to help you determine which fields you are referring to. So for example, here are a few examples:
Address 45 / 0f299a4b-7ab9-42dd-a53f-20b11f39e948
Home Tele 50 / 0e1c0e91-c87e-4f29-b859-c48b3a0f9884
Within these examples we are just noting the Address/Home reference's for our notes, really the only key pieces of information are the 45 / 50 which represent the DNN Pfofile Property ID. The other data is the unique identifier that represents the DynamicQuestionID.
Step 3: This is the important part… From here you can run a simple query for retrofitting all past data that was previously only stored in the DynamicRegistration_QuestionResponse table.
Declare @intPropID integer
Declare @DynQuestionID UniqueIdentifier
Set @intPRopID = 45
Set @DynQuestionID = '0f299a4b-7ab9-42dd-a53f-20b11f39e948'
Insert Into UserProfile (UserID, PropertyDefinitionID, PropertyValue, Visibility, LastUpdatedDate)
Select a.UserID, @intPropID, b.[Response], 2, GetDate() from Users A
Inner Join DynamicRegistration_QuestionREsponse B on A.UserID = B.UserID AND B.DynamicQuestionID = @DynQuestionID
Where (Select Count(*) From USerProfile Where A.USerID = UserProfile.UserID and PropertyDefinitionID = @intPropID) = 0
For each profile property you would just need to swap out those two numbers above (@intPropID and also @DynQuestionID) from the references you collected within Step 2.
Hope this helps you out! If you still need assistance or want us to handle it directly you can pick up some Premium Support hours at http://www.datasprings.com/PremiumSupport.
Thanks!
-Chad