Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to increase height of the box the user down list box ?

chercm
Mega Sage

Hi 

 

i want to increase the height of the box not the lookup list on the widget page 

 

chercm_0-1722433928544.png

 

 

i do not want to be like this 

 

chercm_0-1722434133436.png

 

 

1 REPLY 1

Bhavya11
Kilo Patron
Kilo Patron

Hi @chercm ,

 

can you try like below
HTML:

 

          <div class="col-xs-6">
     
              <label for="firstname"><b>User Name</b></label>
              <span style="padding-right: .25em" title="Mandatory" 
                    class="fa fa-asterisk mandatory"
                    ng-class="{'mandatory-filled': username.value != ''}"></span>

              <sn-record-picker id="firstname" field="username" 
                                table="'sys_user'"
                                default-query="data.existUserid" 
                                display-field="'name'" 
                                display-fields="'email'"
                                value-field="'sys_id'" 
                                search-fields="'name,email'" 
                                page-size="100">
              </sn-record-picker>
                      <input type="button" value="Submit" ng-click="c.submit()"/>


            </div>
    

 

 

Client controller:

 

api.controller=function($scope, spUtil) {
	/* widget controller */
	var c = this;
	c.email = "";
	$scope.username = {displayValue:"",
										 value:"",
										 name:"username"};

	$('#addexUserForm').modal('show');

	c.submit = function() {
		console.log($scope.username.value);
		if ($scope.username.value == '') {
			alert("Input missing");
		} else {
			//Do the submit

			//action is only required if you will be doing additional different call backs
			c.server.get({"action":"submit", 
										"id":$scope.username.value}).then(function(_response){

				if (_response.data.myReturnedVal == 'Complete') {
					$('#addexUserForm').modal('hide');
					spUtil.addInfoMessage("This is now complete");
				}

			})

		}
	}


};

 

 

Server:

 

(function() {

	if (input && input.action == 'submit') {
		//Do something with user's sys_id "input.id"
		data.myReturnedVal = 'Complete';
	}

})();

 

 

 

 

Output:

Bhavya11_0-1723102637340.png

 

Please mark helpful & correct answer if it's really worthy for you.

 

 

Thanks,

BK