getPercentageForCustomVariable(customVariable, customVariableValue, filter, onSuccess)

Description

This function will help you to fetch the response percentage for a specific custom variable. You can also filter out the average response value by passing the filter in the function. Note: This function is an async function and doesn't return any value. The value can be fetched through onSuccess function as below
getPercentageForCustomVariable(customVariable, customVariableValue, filter, function(value) {
//You will get the value here, so write your code here
})


Example:

  • getPercentageForCustomVariable(‘custom3’, ‘customValue1’, {}, function(value) {})
  • getPercentageForCustomVariable(‘custom3’, ‘customValue1’, {segmentCode: [‘S1’, ‘S2’]}, function(value) {})
  • getPercentageForCustomVariable(‘custom3’, ‘customValue1’, {product: [‘p1’, ‘p2’]}, function(value) {})
  • getPercentageForCustomVariable(‘customMapped3’, ‘customValue1’, {productGroup: [‘pg1’, ‘pg2’]}, function(value) {})
  • getPercentageForCustomVariable(‘custom3’, ‘customValue1’, {isCompleted: ‘true’}, function(value) {})
  • getPercentageForCustomVariable(‘custom3’, ‘customValue1’, {questionID: [123, 234,345,456]}, function(value) {})
  • getPercentageForCustomVariable(‘custom3’, ‘customValue1’, {customVariables: [{‘custom1’ :[‘v1’, ‘v2’]}, {‘custom40’: [‘v3’, ‘v4’]}]}, function(value) {})
  • getPercentageForCustomVariable(‘customMapped3’, ‘customValue1’, {dateRange: {start : ‘10/20/2021’, end : ‘04/30/2021’}}, function(value) {})


Refer to Filters for more information