Creating Public Surveys for ConsumersIn CSM, there are two types of consumer tables: csm_consumer_user: this table is extended from sys_user and stores the registered consumer records.csm_consumer: this table is NOT extended from sys_user table and stores the unregistered consumers. The Consumer field on the Case table references the csm_consumer table, which enables agents to create cases for unregistered users too. In the B2C use case, there are times when you want to send surveys to your consumers to get feedback on the type of the service they received once their cases are closed or resolved. Non-public surveys in ServiceNow have a known limitation where the trigger condition’s User field can only be set to a table or a reference table that references the sys_user table. Due to this limitation, survey records do not get created for the records in the csm_consumer table because the csm_consumer table does not extend from sys_user and consumers do not have any access to the instance. There are two options for sending surveys to non-registered consumers: public surveys and non-public surveys. These options are discussed below. Option 1: Public Surveys Make your survey accessible to the public by clicking the Enable Public Access UI action, which makes the survey available to users who are not logged in to the instance. This option generates a static URL that can be sent from a Flow Designer or email notification based on the conditions that trigger the survey. The static URL can be appended with the following two parameters which link the survey to the Case record that triggered the email. sysparm_trigger_table: the Case Table (sn_customerservice_case)sysparm_trigger_id: the sysId of the record that triggered the flow/email notification. These parameters populate the Trigger Id reference field with the correct data on the survey instance which can then be used for reporting or analysis purpose. Note: Set the Allow survey link from email to open in service portal view (applies only for surveys) property value to false to disable survey records from opening in Service Portal. Option 2: Non-public Surveys If you do not want to make the survey public, then the consumer must be registered and assigned the appropriate roles (sn_customerservice.consumer). Before your trigger point for the survey in the business rule, do the following: Copy the record from the csm_consumer table to the csm_consumer_user table.Add the corresponding reference to this new record back on the csm_consumer table’s User field to use the existing trigger condition. Example: function onAfter(){ var consumer = new GlideRecord('csm_consumer'); consumer.get(current.consumer); var gr = new GlideRecord("csm_consumer_user"); gr.initialize(); if(gs.nil(consumer.getValue('user'))){ gr.first_name = consumer.first_name; gr.last_name = consumer.last_name; gr.email = consumer.email; gr.user_name = consumer.email; var user = gr.insert(); consumer.user = user; consumer.update(); } (new sn_assessment_core.AssessmentCreation()).conditionTrigger(current, 'a491d4f1c311220071d07bfaa2d3ae85'); } Note: Because the csm_consumer_user table is an extension of the sys_user table, it is recommended that you do not overload it with user data that will be used only once. In such cases, set up a scheduled job to clear out these records that were created just for the surveys.