Welcome, Guest
Username: Password: Remember me

TOPIC: Can I set the User ID to my own custom number?

Can I set the User ID to my own custom number? 2 years 10 months ago #72138

  • wfluharty
  • wfluharty's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
I already have a user ID that I want to be able to pass TO limeSurvey and have it set the User ID (specifically in the users table) to my custom ID. I do understand I could pass the LimeSurvey user ID back to myself and create my own relationship but I can eliminate additional information if I can set the user ID myself.
The administrator has disabled public write access.

Re: Can I set the User ID to my own custom number? 2 years 10 months ago #72142

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5423
  • Thank you received: 307
  • Karma: 252
Sorry, I don't understand what you are up to. Can you explain your plans in more detail?

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Can I set the User ID to my own custom number? 2 years 10 months ago #72149

  • wfluharty
  • wfluharty's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
We have an existing customer database that we have added surveys to. In our database we already have our own user id number. For instance, let's say my id is 12345 in our system. We have integrated LimeSurvey into our system. I want to be able to match the LimeSurvey answers to the user in our system. When the user starts a new survey LimeSurvey assigns them a sequential user ID and stores that in the "users" database. For instance, if I take a survey in our system, LimeSurvey assigns a sequential ID to my answers and let's say I am the 42nd person to take the survey then I am user ID 42. I know that I can take the LimeSurvey ID and pass it back to myself in the end URL as "&id={saveid}" (&id=42), but that means I now have to store additional information in our existing databases to match our existing ID (12345) to the LimeSurvey ID (42) not to mention I would have to also pass which survey it is that they took because if I create other surveys in the future I need to know which survey it was and what their LimeSurvey ID was in order to match it back up again.

What I want to be able to do is tell LimeSurvey that user 12345 is taking this survey and have it store the ID that I pass it as the unique ID instead of the sequential ID that it assigns to it now.

Does that explain it better or did I just confuse it even worse?
The administrator has disabled public write access.

Re: Can I set the User ID to my own custom number? 2 years 10 months ago #72153

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6551
  • Thank you received: 869
  • Karma: 257
Hello,

1: i think it's a bad idea to modify the id of the answer : is is an autoincremented data in lime_survey_XXXX
2: you can't do it without great modification of LS core.

And you can use your own "create token" script to have the answers link with your user.

I have already make an "own create token" and put the external user id in the surname ( can use token, but it's not very secure ).

And , you can fill a answer with your user-id too : docs.limesurvey.org/tiki-index.php?page=...using_the_survey_URL

Denis
Last Edit: 2 years 10 months ago by DenisChenu.
The administrator has disabled public write access.

Re: Can I set the User ID to my own custom number? 2 years 10 months ago #72154

  • wfluharty
  • wfluharty's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Agreed. The more I think about it, the more I realize that changing the ID within LS might not be such a good idea. But what about passing it information and having it save it to a custom field such as "external_id" or "custom_id" or even "notes". Is there any way that I can pass my own ID into LS and have it store it in the survey database for my reference?
The administrator has disabled public write access.

Re: Can I set the User ID to my own custom number? 2 years 10 months ago #72183

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4360
  • Thank you received: 827
  • Karma: 381
Is there any way that I can pass my own ID into LS and have it store it in the survey database for my reference?
Yes, as Shnoulle says, you can pass an ID into a hidden question via the URL - docs.limesurvey.org/tiki-index.php?page=...using_the_survey_URL
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 2 years 10 months ago by tpartner.
The administrator has disabled public write access.

Re: Can I set the User ID to my own custom number? 2 years 10 months ago #72190

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5423
  • Thank you received: 307
  • Karma: 252
How do you provide the URL to a certain survey to a user? If you can edit the link as suggested above, you can easily store the user ID in a hidden question.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.115 seconds
Donation Image