SLACK: Posting a Message to a Slack Channel

How to:

SLACK posts a message to a Slack channel from a procedure:

Syntax: How to Post a Message to a Slack Channel

SLACK(workspace, channel, message)

where:

workspace

Is a Workspace name.

channel

Is a Channel name.

message

Is an alphanumeric field containing the message.

Example: Sending a Slack Message From a Request

The Adapter for Slack has been configured to have a connection to the devibi workspace, as shown in the following image.

The following request sends a Slack message to the general channel of the devibi Workspace, when the department is MIS.

TABLE FILE ibisamp/EMPLOYEE       
SUM
  CURR_SAL
  AND COMPUTE SLACK_MESSAGE/A200 = 'Salary for Department ' | DEPARTMENT || ' is ' | LJUST(20, FPRINT(CURR_SAL,'D12.2M'), 'A20');  
  AND COMPUTE CURR_SAL_SLACK/A20=IF DEPARTMENT EQ 'MIS' 
      THEN SLACK('devibi', 'general', SLACK_MESSAGE) ELSE 'false';
      AS 'Message Sent,to Slack highlighting,Salary'
BY DEPARTMENT   
HEADING 
"Slack"    
"Slack Function Example"  
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL  
ON TABLE SET STYLE * 
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$  
ENDSTYLE  
END  

The output is shown in the following image.

The message in the Slack channel is shown in the following image.