• Partners
  • Email Us
  • Product
    • Channels
      • Voice
      • Email
      • SMS
      • Chat
      • Messenger
      • Omnichannel
    • Features
      • Predictive Dialer
      • VCC Live Pay
      • Outbound IVR
      • Inbound IVR
      • Voicemail Detection
      • Live Dashboards
      • ACD
      • Salesforce Integration
      • Dialogflow
  • Solutions
    • Customer Service
    • Sales Teams
    • Debt Collection
    • Virtual Call Center
  • Pricing
  • Resources
    • Blog
    • Case Studies
    • Ebooks
    • Courses
    • Webinars
    • Information Security
    • Learning Center
    • Developers
  • Company
    • About us
    • Careers
    • News
    • Partners
  • Partners
  • Email Us
+44 208 638 0169
GET STARTED
Developer GuidesScript SDKFunctionsinArray
  • Overview
    • About Script SDK
    • Examples
  • Constants
    • CONTROLLER_HELPERS
    • DISPOSITION_ASSESMENTS
    • FIELD_QUOTAS
    • FIELD_TYPES
  • Variables
    • fields
    • isAgent
    • isInbound
    • isTest
  • Functions
    • addVoicefileTag
    • alert
    • callCustomerApi
    • clearDtmf
    • confirm
    • contains
    • dump
    • getChannelVariable
    • getCommission
    • getController
    • getCurrentPage
    • getFieldNames
    • getFieldProp
    • getFieldValue
    • getFieldValues
    • getGoogleAccessToken
    • getMicrosoftAccessToken
    • getPages
    • getPrice
    • getQuotaFieldData
    • getScriptVariable
    • getTabs
    • goNext
    • goTab
    • httpRequest
    • inArray
    • isSelected
    • isVoiceRecordingActive
    • runApplication
    • salesforce.getAccessToken
    • searchObject
    • setDisposition
    • setEventListener
    • setFieldValue
    • startVoiceRecording
    • stopVoiceRecording
    • toggleVoiceRecording
    • transfer
  • Events
    • controller.afterSetData
    • controller.onLoadData
    • global.beforeSetDisposition
    • global.onCall
    • global.onLoad
    • global.onHangup
    • page.checkBeforeLoad
    • page.onLoad
    • page.onNext
  • Objects
    • CONTROLLER_OBJECT
    • DISPOSITION_OBJECT
    • FIELD_PROPERTY_OBJECT
    • FIELD_VALUE_OBJECT
    • QUOTA_DATA_OBJECT
Back to Support and Learning Center
English Hungarian

inArray

Check that the array contains the given element.

Description

vcc.inArray(array: any[], element: any): boolean

Searches array for element and returns true if successful.

Parameters

array
We look for the element within this array.

element
We look for this element within the array.

Return values

Returns true if the element is found in the array, false otherwise.

Example

In most situations using vcc.isSelected is a good solution, but suppose that we have a list of postal codes and we have to look for the given one.

var allowedValues = ['2034', '2579', '1069', '5173'];
vcc.alert(vcc.inArray(allowedValues, '1069') ? 'found' : 'not found');
vcc.alert(vcc.inArray(allowedValues, '2000') ? 'found' : 'not found');
Back to Support and Learning Center

Comments

Can’t find what you need? Use the comment section below to connect with others, get answers from our experts, or share your ideas with us.


There are no comments yet.

Click here to cancel reply.

Please note that by clicking on the Submit button, you agree to a member of VCC Live team contacting you with business offers. You can find detailed information on how we can establish contact with you in our Privacy Policy

  • Channels
    • Voice
    • Email
    • SMS
    • Chat
    • Messenger
    • Omnichannel
  • Main Features
    • Call Center Software
    • Predictive Dialer
    • VCC Live Pay
    • Outbound IVR
    • Inbound IVR
    • Voicemail Detection
    • Live Dashboards
    • ACD
    • Salesforce Integration
    • Dialogflow
  • Solutions
    • Customer Service
    • Sales Teams
    • Debt Collection
    • Virtual Call Center
  • Resources
    • Blog
    • Case Studies
    • Ebooks
    • Courses
    • Webinars
    • Information Security
    • Learning Center
    • Developers
    • Download
  • Company
    • About us
    • Careers
    • News
    • Partners
https://vcc.live/wp-content/uploads/2019/07/iso-cert-1.png https://vcc.live/wp-content/uploads/2019/07/iso-cert-2.png https://vcc.live/wp-content/uploads/2019/07/iso-cert-3.png
Social Media
https://vcc.live/wp-content/uploads/2019/07/linkedin.svg https://vcc.live/wp-content/uploads/2019/07/twitter.svg https://vcc.live/wp-content/uploads/2019/07/facebook-1.svg https://vcc.live/wp-content/uploads/2019/07/instagram-1.svg
Call us
Hungary
+36 19996400
UK
+44 2086380169
Germany
+49 3021782516
Poland
+48 123950886
Romania
+40 31706167
USA
+1 3024988337
Hungary
+36 19996400
UK
+44 2086380169
Germany
+49 3021782516
Poland
+48 123950886
Romania
+40 31706167
USA
+1 3024988337
  • Privacy Policy
  • Cookie Policy
  • Legal Statement
  • General Terms of Agreement
  • Magyar nyelvű jogi dokumentumok