Documents
HomeAcademyContactInstallation Guide
User Manual
User Manual
  • Introduction & High Level Architecture
  • 200 OK Versions
    • Prerequisites
      • Internal Authentication Setup
      • Configuration for Email Threshold
    • Release Notes 200 OK Version 5.68.0
    • Release Notes 200 OK Version 5.36.0
    • Release Notes 200 OK Version 5.0.0
    • Release Notes 200 OK Version 4.26.0
    • Release Notes 200 OK Version 4.22.0
    • Release Notes 200 OK Version 4.6.0
    • Release Notes 200 OK Version 4.1.0
    • Release Notes 200 OK Version 3.47.0
    • Release Notes 200 OK Version 3.41.0
  • 200 OK UI Walkthrough
  • Access Configuration
  • Integration Channel
    • How to Create an Integration Channel.
    • Run Your Integration Channel: Let’s Make It Happen!
  • Integration Actions
    • Data Store
    • sObject
    • Apex Class
    • File
    • Platform Event
    • Quick Action
    • Global Action
    • Big Object
    • External Object
    • Integration Channel
    • Auto-launched Flow
    • Callback (client callback)
    • Custom Settings
    • Custom Metadata Type
    • Custom Label
    • Push Notification
  • ETL
    • Create Your ETL
      • Data Source
      • Transform
      • Load
      • Additional Features of ETL
  • Webhook
    • Setting Up Your Webhook!
    • Create Your Webhook!
    • Putting Your Webhook to the Test!
  • Invoke Integration Channel
    • Flow into Action: Invoking Your Integration Channel!
    • Unleash the Power: Invoke with Apex!
  • LWS
    • Transform Data on Demand: ETL as an API!
    • Supercharge Your Workflow: Invoke Integration Channel via API!
  • Built-in Functions
    • Text
      • getChar
      • extract
      • proper
      • len
      • trim
      • rightPad
      • leftPad
      • left
      • right
      • mid
      • getCharIndex
      • coalesce
      • toBoolean
      • toDecimal
      • split
      • replace
      • remove
      • toLowerCase
      • ascii
      • begins
      • capitalize
      • contains
      • deDuplicate
      • escapeHtml
      • generateRandomString
      • getValueFromResponseHeader
      • join
      • reverse
      • startCase
      • stripHtml
      • toBinaryBase64
      • toInt
      • toString
      • toUpperCase
      • escapeMarkDown
    • Math
      • abs
      • acos
      • asin
      • average
      • base64Decode
      • base64Encode
      • ceil
      • generateRandom
      • max
      • min
      • parseNumber
      • round
      • sum
      • switch
      • floor
    • Date & Time
      • toSeconds
      • daysBetween
      • dayPrecision
      • setHour
      • daysInMonth
      • dateTimeNow
      • netWorkDays
      • dateAdd
      • dateDiff
      • addMonths
      • date
      • dateTimeValue
      • dateValue
      • day
      • dayofYear
      • formatDate
      • formatDateToday
      • formatDateTodayFormat
      • formatDateTodayUnix
      • formatDateUnix
      • formatDateUnixFormat
      • toTime
      • toDate
      • toDateTime
      • toDateTimeUnix
    • Advanced
      • generateUUID
      • uncompress
      • compress
      • exists
      • dwTransform
      • discard
      • currencyRate
      • decodeUrl
      • encodeUrl
      • getChannelData
      • getLink
      • invokeFlow
      • invokeETL
      • lookup
      • md5
      • sha1
      • sha256
      • sha512
      • toJson
    • Logical
      • and
      • blankValue
      • case
      • if
      • isBlank
      • isNull
      • isNumber
      • not
      • nullValue
      • or
  • Custom Function
  • Filters for Integration Action
  • Data Mapping Types
    • Key/Value
    • JSON
  • Global variables for Data Mapping
    • Index
    • Record field
    • User
    • Organization
    • Custom Settings
    • Custom Metadata Type(MDT)
  • Advance Setting
  • Schedule
  • Utilities
    • Add Remote Site
    • Json To Apex
    • JSON parser invocable method
    • Export/Import Functionality
    • Import from Postman
    • Curl Import
    • Apex Class Template Creation for Header, Request and Response.
  • Logging
  • Monitor
    • Measure and track the usage
    • Integration channel (total active channels)
    • Callouts (total monthly callouts)
  • Most frequently used scenarios
    • Efficient Bulk Data Handling Using "!index"
    • How to access authentication data from a custom setting?
    • How to set up auth provider and named credentials?
    • How to use named credentials in an integration channel?
    • How to invoke integration channels from flow?
      • Screen flow
      • Record trigger flow
      • Platform event
      • Scheduled flow
    • How to set up a quick action with the integration channel flow?
Powered by GitBook
On this page
  1. Invoke Integration Channel

Unleash the Power: Invoke with Apex!

PreviousFlow into Action: Invoking Your Integration Channel!NextLWS

Last updated 5 months ago

Using Apex, you can invoke the Integration Channel to make callouts to an external system. Here, you have two ways to invoke integration channel in Apex :- 1. Simulate the Integration Channel in synchronous mode 2. Simulate the Integration Channel in Asynchronous mode 1. Simulate the Integration Channel in synchronous mode

It will execute the integration channel in synchronous mode you can refer to below.

How to use integration channel in Apex

To simulate the Integration channel in apex, use the following lines of code. lwapic.ICChannelRequest instance = new lwapic.ICChannelRequest(); instance.channelName = 'Push_Data_to_Power_BI'; // pass the channel API name //instance.requestPayload = '{"rows":[{"StageName":"Prospecting","Name":"Sobha 200 OK"}]}'; // If required pass the body instance.queryParams = value 1, value 2,value 3; //If you want to pass values dynamically eg :- {0},{1},{2},... are set in endpoint or query params of integration channel and comma(,) is the request data separator List<lwapic.ICChannelRequest> resList= new List<lwapic.ICChannelRequest>(); resList.add(instance); List<lwapic.ICResponseWrapper> respWrapList = lwapic.ICControllerSync.execute(resList); If Integration channel is excepting some inputs to be passed while simulating the channel at runtime, in the above code, you have global class named ‘ ICChannelRequest ’. In the same class, there are several global variables( recordId, queryParams, requestPayload, etc. ) by which you are going to set the values to the channel at runtime. Navigate to the developer console by using the setup gear icon. Then, for understanding the process, navigate to execute anonymous window and paste the above code to simulate the channel. You can use the above code in any class or any method as per the requirement, as shown in the image below.

*Note :- After simulating the integration channel in synchronous mode, you can obtain the response of the channel using the global class named 'ICResponseWrapper' to use it further. 2. Simulate the Integration Channel in Asynchronous mode It will execute the integration channel in asynchronous mode. You can refer to below

Similar to synchronous mode, only change is instead of lwapic.ICControllerSync.execute(resList); you need to use lwapic.ICControllerASync.execute(resList); in Apex to simulate the channel in asynchronous mode, as shown below. lwapic.ICChannelRequest instance = new lwapic.ICChannelRequest(); instance.channelName = 'Push_Data_to_Power_BI'; // pass the channel API name //instance.requestPayload = '{"rows":[{"StageName":"Prospecting","Name":"Sobha 200 OK"}]}'; // If required pass the body instance.queryParams = value 1, value 2,value 3; //If you want to pass values dynamically eg :- {0},{1},{2},... are set in endpoint or query params of integration channel and comma(,) is the request data separator List<lwapic.ICChannelRequest> resList= new List<lwapic.ICChannelRequest>(); resList.add(instance); lwapic.ICControllerASync.execute(resList); // Don't store in any variable as Sync execution because it doesn't return any response in ASync Execution

*Note :- After simulating the integration channel in asynchronous mode, no output will be immediately available since it operates asynchronously.