<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How do I call a &amp;lt;sn-record-picker&amp;gt; in a spModal ? in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689449#M1041709</link>
    <description>&lt;P&gt;Hi everyone, I want to put a &amp;lt;sn-record-picker&amp;gt;&amp;nbsp; inside a spModal, but Im not sure how to do this, can anyone help ?&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;HTML:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div id="AtualizarButton" class="panel panel-default"&amp;gt;
    &amp;lt;div class="panel-heading"&amp;gt;${Atualizar}&amp;lt;/div&amp;gt;
    &amp;lt;div class="panel-body"&amp;gt;
     &amp;lt;button type="button" class="btn btn-primary btn-block" style="background-color: #3641B3;" ng-click="c.onAlert()"&amp;gt;${Atualizar} 
&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

WHAT I WANT TO PUT INDE THE spModal
&amp;lt;sn-record-picker id="AssignToPicker" field="user" table="'sys_user'" display-field="'name'" value-field="'sys_id'" search-fields="'name'" page-size="100" &amp;gt;&amp;lt;/sn-record-picker&amp;gt;
&amp;lt;button type="submit" class="btn btn-primary" ng-click="saveUser()" id="btnSubmit" &amp;gt;${Submit}&amp;lt;/button&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Server Script:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(function() {
  /* populate the 'data' object */
    // Get table &amp;amp; sys_id
    data.table = $sp.getParameter("table");
    data.sys_id = $sp.getParameter("sys_id");

    // Valid GlideRecord
    gr = new GlideRecord(data.table);
    if (!gr.isValid())
        return;

    // Valid sys_id
    if (!gr.get(data.sys_id))
        return;

    data.state = gr.getValue('state');
    data.unid = gr.getValue('sys_class_name');
	data.resolved = gr.getValue('resolved');

    if (input &amp;amp;&amp;amp; input.action) {
        var action = input.action;

        // If Incident table
        if (action == 'resolve') {
            gr.setValue('resolved', true);
            gr.setValue('state', 3);
            gr.update();
            gs.addInfoMessage("O pedido foi fechado.");
        }
    }

    data.state = gr.getValue('Assigned To');
	
		data.user = '';

		data.user_dv = '';

		if (input &amp;amp;&amp;amp; input.action == "saveUser") {

			//here you cad use the selected user id &amp;amp; name from the input variables

			// and save or process your business logic
			gr.assigned_to = input.selected_user_id;
			gr.variables.assigned_to = input.selected_user_id;
			gr.update();
		}

})();&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Client Controller:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;api.controller = function($window, $location, spModal) {
    /* widget controller */
    var c = this;
    c.action = function(state) {
        c.data.state = state;
    };


    c.onAlert = function() {
        var c = this;
        c.onAlert = function() {
            spModal.confirm('Test').then(function(answer) {
                if (answer) {
                    c.uiAction('resolve');
                }
            });
        }
    }
};&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 03 Oct 2023 09:59:08 GMT</pubDate>
    <dc:creator>F_bio Santos</dc:creator>
    <dc:date>2023-10-03T09:59:08Z</dc:date>
    <item>
      <title>How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689449#M1041709</link>
      <description>&lt;P&gt;Hi everyone, I want to put a &amp;lt;sn-record-picker&amp;gt;&amp;nbsp; inside a spModal, but Im not sure how to do this, can anyone help ?&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;HTML:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div id="AtualizarButton" class="panel panel-default"&amp;gt;
    &amp;lt;div class="panel-heading"&amp;gt;${Atualizar}&amp;lt;/div&amp;gt;
    &amp;lt;div class="panel-body"&amp;gt;
     &amp;lt;button type="button" class="btn btn-primary btn-block" style="background-color: #3641B3;" ng-click="c.onAlert()"&amp;gt;${Atualizar} 
&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

WHAT I WANT TO PUT INDE THE spModal
&amp;lt;sn-record-picker id="AssignToPicker" field="user" table="'sys_user'" display-field="'name'" value-field="'sys_id'" search-fields="'name'" page-size="100" &amp;gt;&amp;lt;/sn-record-picker&amp;gt;
&amp;lt;button type="submit" class="btn btn-primary" ng-click="saveUser()" id="btnSubmit" &amp;gt;${Submit}&amp;lt;/button&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Server Script:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(function() {
  /* populate the 'data' object */
    // Get table &amp;amp; sys_id
    data.table = $sp.getParameter("table");
    data.sys_id = $sp.getParameter("sys_id");

    // Valid GlideRecord
    gr = new GlideRecord(data.table);
    if (!gr.isValid())
        return;

    // Valid sys_id
    if (!gr.get(data.sys_id))
        return;

    data.state = gr.getValue('state');
    data.unid = gr.getValue('sys_class_name');
	data.resolved = gr.getValue('resolved');

    if (input &amp;amp;&amp;amp; input.action) {
        var action = input.action;

        // If Incident table
        if (action == 'resolve') {
            gr.setValue('resolved', true);
            gr.setValue('state', 3);
            gr.update();
            gs.addInfoMessage("O pedido foi fechado.");
        }
    }

    data.state = gr.getValue('Assigned To');
	
		data.user = '';

		data.user_dv = '';

		if (input &amp;amp;&amp;amp; input.action == "saveUser") {

			//here you cad use the selected user id &amp;amp; name from the input variables

			// and save or process your business logic
			gr.assigned_to = input.selected_user_id;
			gr.variables.assigned_to = input.selected_user_id;
			gr.update();
		}

})();&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Client Controller:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;api.controller = function($window, $location, spModal) {
    /* widget controller */
    var c = this;
    c.action = function(state) {
        c.data.state = state;
    };


    c.onAlert = function() {
        var c = this;
        c.onAlert = function() {
            spModal.confirm('Test').then(function(answer) {
                if (answer) {
                    c.uiAction('resolve');
                }
            });
        }
    }
};&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 Oct 2023 09:59:08 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689449#M1041709</guid>
      <dc:creator>F_bio Santos</dc:creator>
      <dc:date>2023-10-03T09:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689466#M1041718</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/371787"&gt;@F_bio Santos&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To put a &amp;lt;sn-record-picker&amp;gt; inside a spModal, you can try below steps -&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Add the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;sn-record-picker&amp;gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;element to the template of the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;spModal.&lt;/LI&gt;&lt;LI&gt;Pass the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;spModal&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;object to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;sn-record-picker&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;element as a prop.&lt;/LI&gt;&lt;/OL&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;HTML&lt;/SPAN&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;&amp;lt;&lt;SPAN class=""&gt;sp-modal&lt;/SPAN&gt; &lt;SPAN class=""&gt;id&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"AssignToUserModal"&lt;/SPAN&gt; &lt;SPAN class=""&gt;header&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"Assign to User"&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=""&gt;&amp;lt;&lt;SPAN class=""&gt;sn-record-picker&lt;/SPAN&gt; &lt;SPAN class=""&gt;id&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"AssignToPicker"&lt;/SPAN&gt; &lt;SPAN class=""&gt;field&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"user"&lt;/SPAN&gt; &lt;SPAN class=""&gt;table&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"'sys_user'"&lt;/SPAN&gt; &lt;SPAN class=""&gt;display-field&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"'name'"&lt;/SPAN&gt; &lt;SPAN class=""&gt;value-field&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"'sys_id'"&lt;/SPAN&gt; &lt;SPAN class=""&gt;search-fields&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"'name'"&lt;/SPAN&gt; &lt;SPAN class=""&gt;page-size&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"100"&lt;/SPAN&gt; &lt;SPAN class=""&gt;sp-modal&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"spModal"&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;lt;/&lt;SPAN class=""&gt;sn-record-picker&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=""&gt;&amp;lt;&lt;SPAN class=""&gt;button&lt;/SPAN&gt; &lt;SPAN class=""&gt;type&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"submit"&lt;/SPAN&gt; &lt;SPAN class=""&gt;class&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"btn btn-primary"&lt;/SPAN&gt; &lt;SPAN class=""&gt;ng-click&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"saveUser()"&lt;/SPAN&gt; &lt;SPAN class=""&gt;id&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"btnSubmit"&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;Submit&lt;SPAN class=""&gt;&amp;lt;/&lt;SPAN class=""&gt;button&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class=""&gt;&amp;lt;/&lt;SPAN class=""&gt;sp-modal&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Then, in your client controller, you can open the modal using the spModal.open() function.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;c.onAssignToUser = &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;function&lt;/SPAN&gt;() &lt;/SPAN&gt;{
  spModal.open({
    &lt;SPAN class=""&gt;id&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'AssignToUserModal'&lt;/SPAN&gt;
  });
};&lt;/PRE&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;When the modal opens, the &amp;lt;sn-record-picker&amp;gt; element will be rendered inside of the modal. The user can then select a user and click the "Submit" button to save the selection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also make sure that the &amp;lt;sn-record-picker&amp;gt; element is a ServiceNow widget, so you will need to include the ServiceNow widget library in your Service Portal page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Tushar&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 10:25:48 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689466#M1041718</guid>
      <dc:creator>Tushar</dc:creator>
      <dc:date>2023-10-03T10:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689507#M1041731</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/410698"&gt;@Tushar &lt;/a&gt;&amp;nbsp;it didnt work, what I want is when I click this button:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="F_bioSantos_0-1696331295941.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/293769i11D49C95E9226110/image-size/medium?v=v2&amp;amp;px=400" srcset="/community/image/serverpage/image-id/293769i11D49C95E9226110/image-size/medium?v=v2&amp;amp;px=400 1.0x" role="button" title="F_bioSantos_0-1696331295941.png" alt="F_bioSantos_0-1696331295941.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Which right now shows this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="F_bioSantos_1-1696331323438.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/293770iE394B96AC1299890/image-size/medium?v=v2&amp;amp;px=400" srcset="/community/image/serverpage/image-id/293770iE394B96AC1299890/image-size/medium?v=v2&amp;amp;px=400 1.0x" role="button" title="F_bioSantos_1-1696331323438.png" alt="F_bioSantos_1-1696331323438.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want it to show this inside the spModal:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="F_bioSantos_2-1696331375697.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/293771i5F5B9F60C3694287/image-size/medium?v=v2&amp;amp;px=400" srcset="/community/image/serverpage/image-id/293771i5F5B9F60C3694287/image-size/medium?v=v2&amp;amp;px=400 1.0x" role="button" title="F_bioSantos_2-1696331375697.png" alt="F_bioSantos_2-1696331375697.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 11:10:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689507#M1041731</guid>
      <dc:creator>F_bio Santos</dc:creator>
      <dc:date>2023-10-03T11:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689522#M1041737</link>
      <description>&lt;P&gt;Update&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/410698"&gt;@Tushar &lt;/a&gt;&amp;nbsp;i changed it a bit and the modal opened with the code you sent, but it does not show the record picker inside it.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 11:24:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689522#M1041737</guid>
      <dc:creator>F_bio Santos</dc:creator>
      <dc:date>2023-10-03T11:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689781#M1041810</link>
      <description>&lt;P&gt;Based on the &lt;A title="spModal Documentation" href="https://developer.servicenow.com/dev.do#!/reference/api/utah/client/SPModal-API?navFilter=spmodal" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt; I set it up as follows.&lt;/P&gt;&lt;P&gt;1. Create a custom widget that holds the record picker directive&lt;/P&gt;&lt;P&gt;*Set an Id on your custom widget&lt;/P&gt;&lt;P&gt;Widget ID:&amp;nbsp; "modal-record-picker"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTML&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div&amp;gt;
  &amp;lt;label&amp;gt;{{data.label}}&amp;lt;/label&amp;gt;
	&amp;lt;sn-record-picker field="c.recObject" table="data.table" search-fields="data.searchFields" display-fields="data.displayFields" value-field="data.valueField" default-query="data.defaultQuery" page-size="data.pageSize"&amp;gt; &amp;lt;/sn-record-picker&amp;gt;
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Server script:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(function() {
    if (input) {
        data.label = input.label;
        data.table = input.table;
        data.searchFields = input.searchFields;
        data.displayFields = input.displayFields;
        data.defaultQuery = input.defaultQuery;
        data.valueField = input.valueField;
        data.pageSize = input.pageSize;
    }
})();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Client Controller:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;api.controller=function($scope) {
  var c = this;
  c.recObject = $scope.widget_parameters.shared;

};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Embed the widget into spModal:&lt;/P&gt;&lt;P&gt;HTML:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div id="AtualizarButton" class="panel panel-default"&amp;gt;
    &amp;lt;div class="panel-heading"&amp;gt;${Atualizar}&amp;lt;/div&amp;gt;
    &amp;lt;div class="panel-body"&amp;gt;
     &amp;lt;button type="button" class="btn btn-primary btn-block" style="background-color: #3641B3;" ng-click="c.openModal()"&amp;gt;${Atualizar} 
     &amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class="m-t-lg wrapper"&amp;gt;
      &amp;lt;h3&amp;gt;{{c.recObject.displayValue}}&amp;lt;/h3&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Client Controller:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;api.controller=function($scope, spModal) {
	var c = this;

	c.recObject = {
		"displayValue":"",
		"name":"user",
		"value":""
	}

	var widgetInput = {
		"label": "${Selecciona un usuario}",
		"table":"sys_user",
		"searchFields": "name,user_id",
		"displayFields": "name,user_id",
		"defaultQuery": "active=true",
		"valueField": "sys_id",
		"pageSize": "10"

	}

        //Set a "widget" property with the widget id given to the widget holding the snRecordPicker directive
	c.openModal = function(){
		spModal.open({
			widget: 'modal-record-picker',
			shared: c.recObject,
			widgetInput: widgetInput,
			scope: $scope
		}).then(function(resp){
			//resp will contain true if "ok" button is selected

			//process c.recObject data as needed here
			console.log("selected record", c.recObject)

		})
	}

};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Demo:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="modal_demo.gif" style="width: 724px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/293852i5C9DA5B728C71AA6/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/293852i5C9DA5B728C71AA6/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="modal_demo.gif" alt="modal_demo.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 13:40:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689781#M1041810</guid>
      <dc:creator>ChrisBurks</dc:creator>
      <dc:date>2023-10-03T13:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689988#M1041870</link>
      <description>&lt;P&gt;Sorry there is somethink I didnt understood. I should create 2 widget's right? One with the directive and other that call's it ?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 16:25:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2689988#M1041870</guid>
      <dc:creator>F_bio Santos</dc:creator>
      <dc:date>2023-10-03T16:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2690083#M1041897</link>
      <description>&lt;P&gt;Yes, that is correct, two widgets. One widget that contains the snRecordPicker directive and another (the one that you already have) where the spModal exists where it's embedded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I think you figured it out.&lt;/P&gt;&lt;P&gt;Glad I could help.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 17:32:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2690083#M1041897</guid>
      <dc:creator>ChrisBurks</dc:creator>
      <dc:date>2023-10-03T17:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2696198#M1043596</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/221087"&gt;@ChrisBurks&lt;/a&gt;, how would I make the choosen user to be the assign_to ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Right now I tried to do this:&lt;BR /&gt;&lt;BR /&gt;Modal Widget:&lt;BR /&gt;HTML:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div&amp;gt;
  &amp;lt;label&amp;gt;{{data.label}}&amp;lt;/label&amp;gt; &amp;lt;!-- {{data.label}} --&amp;gt;
	&amp;lt;sn-record-picker field="c.recObject" table="data.table" search-fields="data.searchFields" display-fields="data.displayFields" value-field="data.valueField" default-query="data.defaultQuery" page-size="data.pageSize"&amp;gt; &amp;lt;/sn-record-picker&amp;gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
  &amp;lt;label&amp;gt;Escreva uma breve descrição da alteração&amp;lt;/label&amp;gt;
  &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
  &amp;lt;textarea id="myTextarea" rows="10" cols="87"&amp;gt;&amp;lt;/textarea&amp;gt;
  &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
  &amp;lt;button type="button" class="btn btn-primary btn-block" style="background-color: #3641B3;" ng-click="c.Assign_to()"&amp;gt;${Atribuir} &amp;lt;/button&amp;gt;
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Client:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;api.controller=function($scope) {
  var c = this;
  c.recObject = $scope.widget_parameters.shared;
		c.Assign_to = function(){
			c.data.action = "Assign_to";


        c.data.selected_user_id = $scope.data.user;

        c.data.selected_user_name = $scope.data.user_dv;
		}
       c.server.update().then(function(r) {

            c.data.action = '';

            c.data.selected_user_id = '';

            c.data.selected_user_name = '';
			
        });

		    $scope.user = {
        displayValue: $scope.data.user_dv, //This should not be null
        value: $scope.data.user, //This should not be null
        name: 'user'
    }

    $scope.$on("field.change", function(evt, parms) {
        if (parms &amp;amp;&amp;amp; parms.field) {
            if (parms.field.name == 'user') {
                $scope.data.user = parms.newValue;
                $scope.data.user_dv = parms.displayValue;
            }
        }
    })

};&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Server Script:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(function() {
    if (input) {
        data.label = input.label;
        data.table = input.table;
        data.searchFields = input.searchFields;
        data.displayFields = input.displayFields;
        data.defaultQuery = input.defaultQuery;
        data.valueField = input.valueField;
        data.pageSize = input.pageSize;
    }
	
	 // Get table &amp;amp; sys_id
    data.table = $sp.getParameter("table");
    data.sys_id = $sp.getParameter("sys_id");

    // Valid GlideRecord
    gr = new GlideRecord(data.table);
    if (!gr.isValid())
        return;

    // Valid sys_id
    if (!gr.get(data.sys_id))
        return;

    data.state = gr.getValue('Assigned To');
	
		data.user = '';

		data.user_dv = '';

		if (input &amp;amp;&amp;amp; input.action == "AssignTo") {

			//here you cad use the selected user id &amp;amp; name from the input variables

			// and save or process your business logic
			gr.assigned_to = input.selected_user_id;
			gr.variables.assigned_to = input.selected_user_id;
			//gs.info('Atribuido a: ');
			gr.update();
			//gs.info('Selected user id: '+input.selected_user_id );

			

}
})();&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;But it didnt work, when I click the button it does nothing ...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 14:21:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2696198#M1043596</guid>
      <dc:creator>F_bio Santos</dc:creator>
      <dc:date>2023-10-09T14:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2696245#M1043613</link>
      <description>&lt;P&gt;I'm not quite sure what you're trying to achieve here. Are you trying to update the record while viewing the modal?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 15:05:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2696245#M1043613</guid>
      <dc:creator>ChrisBurks</dc:creator>
      <dc:date>2023-10-09T15:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2696257#M1043616</link>
      <description>&lt;P&gt;I should ask, if possible, describe the process you're looking for.&lt;/P&gt;&lt;P&gt;For instance:&lt;/P&gt;&lt;P&gt;1. User clicks button to open modal&lt;/P&gt;&lt;P&gt;2. Modal opens displaying record picker field&lt;/P&gt;&lt;P&gt;3. User makes selection&lt;/P&gt;&lt;P&gt;4. User clicks button to accept selection&lt;/P&gt;&lt;P&gt;5. Modal closes and value is sent to backend to update a record&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 15:10:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2696257#M1043616</guid>
      <dc:creator>ChrisBurks</dc:creator>
      <dc:date>2023-10-09T15:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2696328#M1043641</link>
      <description>&lt;P&gt;That's exacly what I need&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 16:40:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2696328#M1043641</guid>
      <dc:creator>F_bio Santos</dc:creator>
      <dc:date>2023-10-09T16:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2696485#M1043683</link>
      <description>&lt;P&gt;Ah, then move the update part into the script which is opening the spModal to process the information in the ".then()" which is triggered when the "OK" button is clicked;&lt;BR /&gt;For example:&lt;/P&gt;&lt;P&gt;Client Controller&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;...
c.openModal = function(){
		spModal.open({
			widget: 'modal-record-picker',
			shared: c.recObject,
			widgetInput: widgetInput,
			scope: $scope
		}).then(function(resp){
			//executes after the "ok" button is clicked

			//process c.recObject data as needed here
			c.server.get({
				action: "ASSIGNTO",
				assignee: c.recObject.value
			})

		})
	}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Server script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(function() {
	data.table = $sp.getParameter('table');
	data.sys_id = $sp.getParameter('sys_id');
	
	var inc = new GlideRecord(data.table);

	if(input &amp;amp;&amp;amp; input.action == 'ASSIGNTO'){
		if(inc.get(data.sys_id)){
			inc.assigned_to = input.assignee.toString();
			inc.update();
		}

	}
})();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;I put the simple list widget on the page so that it can be seen when the record gets updated&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="update_incident_spmodal.gif" style="width: 450px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/295770i038CF22FF4EA39F7/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/295770i038CF22FF4EA39F7/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="update_incident_spmodal.gif" alt="update_incident_spmodal.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 19:18:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2696485#M1043683</guid>
      <dc:creator>ChrisBurks</dc:creator>
      <dc:date>2023-10-09T19:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2697036#M1043830</link>
      <description>&lt;P&gt;Thank you a lot for the help&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/221087"&gt;@ChrisBurks&lt;/a&gt;, I was overthinking the solution, this helped a lot&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 09:06:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2697036#M1043830</guid>
      <dc:creator>F_bio Santos</dc:creator>
      <dc:date>2023-10-10T09:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2697427#M1043974</link>
      <description>&lt;P&gt;You're welcome&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/371787"&gt;@F_bio Santos&lt;/a&gt; . I'm glad I was able to help.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 12:55:48 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2697427#M1043974</guid>
      <dc:creator>ChrisBurks</dc:creator>
      <dc:date>2023-10-10T12:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2698490#M1044332</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/221087"&gt;@ChrisBurks&lt;/a&gt;, sorry for bothering you again, but Im trying to get the value of a &amp;lt;textarea&amp;gt; that is on the "Modal" widget, and put it on a field of the record, I have tried everythink I could remember that could work but got no results, I dont know how to call the html element that is on the "modal" widget&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 09:54:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2698490#M1044332</guid>
      <dc:creator>F_bio Santos</dc:creator>
      <dc:date>2023-10-11T09:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2698813#M1044447</link>
      <description>&lt;P&gt;Hello &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/371787"&gt;@F_bio Santos&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;No worries, no bother.&lt;/P&gt;&lt;P&gt;You should be able to leverage the shared variable "$scope.widget_parameters.shared" which in both widgets has been assigned to c.recObject. In the "Modal" create a new property on that object and assign as the ngModel to the textarea element. Whatever value is added to the textarea will then be available in both the "Modal" widget and the calling widget. In the Promise (.then()) of the spModal.open() method, dot walk out to the new property to access the value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTML of the "Modal" widget:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
&amp;lt;textarea ng-model="c.recObject.textareaData"&amp;gt;&amp;lt;/textarea&amp;gt;
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Client Controller of the widget calling the modal:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;...

c.openModal = function(){
		spModal.open({
			widget: 'modal-record-picker',
			shared: c.recObject,
			widgetInput: widgetInput,
			scope: $scope
		}).then(function(resp){
			//executes after the "ok" button is clicked
            console.log("textareaData: ", c.recObject.textareaData)
                  
			//process c.recObject data as needed here
			c.server.get({
				action: "ASSIGNTO",
				assignee: c.recObject.value
			})

		})
	}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 13:02:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2698813#M1044447</guid>
      <dc:creator>ChrisBurks</dc:creator>
      <dc:date>2023-10-11T13:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2698868#M1044462</link>
      <description>&lt;P&gt;So would I have to do somethink like this on the "Client Controller" of the widget calling the modal ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;c.openModal = function(){
		spModal.open({
			widget: 'modal-record-picker',
			shared: c.recObject,
			widgetInput: widgetInput,
			scope: $scope
		}).then(function(resp){
			//executes after the "ok" button is clicked
            console.log("textareaData: ", c.recObject.textareaData)

           var message = current.getValue("message");

           message = message +  console.log("textareaData: ", c.recObject.textareaData);
                  
			//process c.recObject data as needed here
			c.server.get({
				action: "ASSIGNTO",
				assignee: c.recObject.value
			})

		})
	}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Added this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;           var message = current.getValue("message");

           message = message +  console.log("textareaData: ", c.recObject.textareaData);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Im using a "+" because I want to maintain what's already on the field.&lt;BR /&gt;(Let me know if u need screenshot's explaining it better)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 13:32:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2698868#M1044462</guid>
      <dc:creator>F_bio Santos</dc:creator>
      <dc:date>2023-10-11T13:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2699015#M1044506</link>
      <description>&lt;P&gt;You don't need the console.log. Console.log is to log out the information to the browser console, usually for troubleshooting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just use c.recObject.textareaData:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//you can do this (extra space in there to separate the values of message and textarea data)
message = message + " " + c.recObject.textareaData 

// or this should do the same thing in order to concantenate with the value that already exists in "message"
message += (" " + c.recObject.textareaData)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 15:05:52 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2699015#M1044506</guid>
      <dc:creator>ChrisBurks</dc:creator>
      <dc:date>2023-10-11T15:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2699069#M1044520</link>
      <description>&lt;P&gt;This is inside of the "ok" button right ?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 15:53:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2699069#M1044520</guid>
      <dc:creator>F_bio Santos</dc:creator>
      <dc:date>2023-10-11T15:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call a &lt;sn-record-picker&gt; in a spModal ?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2699074#M1044523</link>
      <description>&lt;P&gt;Yes, the part when after the "ok" button is clicked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;c.openModal = function(){
		spModal.open({
			widget: 'modal-record-picker',
			shared: c.recObject,
			widgetInput: widgetInput,
			scope: $scope
		}).then(function(resp){
			//executes after the "ok" button is clicked
            

           var message = current.getValue("message");
           message = message +  " " + c.recObject.textareaData;
                  
			//process c.recObject data as needed here
			c.server.get({
				action: "ASSIGNTO",
				assignee: c.recObject.value
			})

		})
	}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 11 Oct 2023 16:02:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-do-i-call-a-lt-sn-record-picker-gt-in-a-spmodal/m-p/2699074#M1044523</guid>
      <dc:creator>ChrisBurks</dc:creator>
      <dc:date>2023-10-11T16:02:54Z</dc:date>
    </item>
  </channel>
</rss>

