On our website we want to make a survey and as an incentive we want to draw a price among all participants. I want to set up a community builder field that indicates if a user has completed the survey. This field is visible and accessible only for administrators.
Users that have an account should log in after completing the survey and the fields status should then automatically change to "has completd survey".
I think this could be accomplished with sessions and a bit of php after the login but what really gives me a headache is: What can I do with users that do not have an account yet?
When a user completes the survey and does not have an account yet, he/she would then have to register, but how can I pass the information that the user that has just registered also has completed the survey? Is this possible with community builder? If yes, could someone please give me some hints, how this can be done?
You could use CB Query Field to query your database to see if the user completed the survey or not and this way it's always dynamic, no updating or user interaction needed, as it'll return whatever you like based off the query results.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Sounds good so I won't have to include the database query via Sourcerer which was the way I intended to do it.
But could you think of a solution for users who are not registered at the time they complete the survey? The plan was to let them complete the survey and afterwards ask them to register in order to enter their address in case they win. My problem is mainly that if someone registers I can't tell whether this user has completed the survey or not. After all I do not want to draw prices to users who did not complete the survey.
Best Regards
I assume the common element between the two systems will be email address, which if is the case just have the query match
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
I'm afraid the email address is not available since the survey is completely anonymous and the email address is not required.
Couldn't I set a cookie and tell Communiy Builder to check for it? So if the cookie is set, Community Builder will set the "has completed survey" flag? So the question is: Is there a way to make CB check for the cookie after the first login and in case it's set trigger the CB Query Field action?
You can try, but you'll need to develop a custom plugin to probably do it. You can try using CB Auto Actions in a Code action with Method set to PHP and checking $_COOKIE, but it's no guarantee. It won't work if the 2 sites are on 2 different domains though. You really need to log something that can relate the user to the survey like email address though as that'd be easiest approach.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.