How to show Survey as Modal Pop-up in Portal

reddy8055
Tera Contributor

Hi,

We have catalog item link in Service portal so whenever user click the link it should show Survey as Modal Pop-up and where user need to fill the survey. So I have modified the widget client script like below its showing survey widget not actual form to fill in. Please help me on this. Thanks

HTML

<button ng-click="c.openSurveyModal()">Report a Problem</button>

Client script:

var p = 'sysparm_assessable_type';
var q = 'instance_id';
 
c.openSurveyModal = function() {
  if (typeof spModal === 'undefined') {
    return;
  }
  spModal.open({
    title: 'Survey',
    widget: 'surveys',
    buttons: [
      { label: '', hide: true },
      { label: '', hide: true }
    ],
    widgetInput: {
     //sys_id: 'f0a6037c977551101eaade24a253afc7'
//sys_id: 'c35a803bdb907600c894591e5e961980'
//p: 'f0a6037c977551101eaade24a253afc7'
q: 'ff010f5b87443550549484c4dabb3507'
 
///window: "/assessment_take2.do?sysparm_assessable_type=f0a6037c977551101eaade24a253afc7"
    },
//templateUrl: 'survey_modal_template.html', 
    onClose: function(result) {
      
    }
  });
    
};
Thanks,
6 REPLIES 6

mregragui_ext
Tera Contributor

@reddy8055 ,

can you please share the code you have used to solve this issue?

Snehal
Tera Expert

@reddy8055 

Hi 
I have the same requirement if you have code to resolve issue please share here ,it's bit urgent .

Help will be much appreciated