Hi guys, in this article I want to discuss about How to use dynamic config for SFTP receiver adapter. As you know, in scenario integration between CPI and SFTP, we have to set hardcode value of SFTP as address, directory, filename, credential… in integration flow with SFTP receiver. For example

In many cases, we have to parameter all of this variable. How to do that ?
Actually, We can use externalize parameter. In newest release, CPI support type DYNAMIC for Proxy Type and Authentication dropdown. If choose this value, configuration will get value from property as
Attribute | SAP property | Type | Values |
Proxy Type | SAP_FtpProxyType | String | internet/onPremise |
Authentication | SAP_FtpAuthMethod | String | key/user/dual |
Timeout | SAP_FtpTimeout | int | Values of type integer |
Max. Reconnect Attempts | SAP_FtpMaxReconnect | int | Values of type integer |
Reconnect Delay | SAP_FtpMaxReconDelay | int | Values of type integer |
Automatically Disconnect | SAP_FtpDisconnect | boolean, string | true/false |
Change Directories Stepwise | SAP_FtpStepwise | boolean, string | true/false |
Create Directories | SAP_FtpCreateDir | boolean, string | true/false |
Use Fast Exists Check | SAP_FtpFastExistsCheck | boolean, string | true/false |
Use Fast Exists Check | SAP_FtpAfterProc | String | Overwrite/Append/Fail/Ignore |
Flatten Filenames | SAP_FtpFlattenFileName | boolean, string | true/false |

Configuration dynamic for SFTP Address
- Add Content Modifier component into integration flow
- Add header as
Name | Source Type | Source value | Data Type |
address | expression | {{address}} | java.lang.String |
credentialName | expression | {{credentialName}} | java.lang.String |
userName | expression | {{userName}} | java.lang.String |
- Add property for content modifier as
Name | Source Type | Source value | Data Type |
SAP_FtpProxyType | expression | {{sftpProxy}} | java.lang.String |
SAP_FtpAuthMethod | expression | {{sftpUser}} | java.lang.String |
If you select DYNAMIC for dropdown proxy type and Credential in iFlow, you have to define propery SAP_FrpProxyType and SAP_FtpAuthMothod. If no, you will take error.


Test configuration
Choose Artifact and click configuration to set value for parameters

Summary
In this article, I discuss about How to configuration for SFTP dynamic. I also talk about Externalize Parameter to set value for parameter from artifact configuration. Thanks for your reading and any question, kindly leave your comment below this article.
Thanks.
Joseph.