Liquid UI - WS Reference Library

Search value in an array


Runs On

  SAP GUI Android iOS WM Web
Direct Connect          
Liquid UI Server Connect        


You can search for a value in an array using the custom find function

User Interface

Validate state button will validate the entered taxable state value

Liquid UI Script


// Author: Synactive, Inc. [1065 E. Hillsdale Blvd, Foster City, CA, 94404, USA]
// Email:;;
// Contact: 650.341.3310
// Version:

var stateArray = ["AK","FL","NV","NH","SD","TN","TX","WA","WY"];  // Non taxable states

inputfield ([2,4], "Taxable State", [2,18],{"name":"z_state", "size":2});
pushbutton([4,4], "Validate State",{"size":[1,15], "process":validate_state});

//Returns true or false if the search element is found in the array
Array.prototype.find = function (p){
    for(i=0;i<this.length;i++)    if(this[i] == p) return true;
    return false;

function validate_state(){
        return('E: Please enter taxable state');