|
How to: |
SLACK posts a message to a Slack channel from a procedure:
SLACK(workspace, channel, message)
where:
Is a Workspace name.
Is a Channel name.
Is an alphanumeric field containing the message.
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.
