I just wanted to ask is there any available sample script using the new 1.4.1 Anaplan Connect? I was able to run successfully Anaplan Connect 1.3 but I am having problems with 1.4. I just need to see a sample script so I can apply it on our Project.
Go to Solution.
I believe there is one in the documentation here:
You can use the below basic script and built further as you wish. This sample script is for importing a file from a local system to Anaplan.
@echo offrem For Windows OS : This example explains the usage of basic Authentication with Anaplan Connect.rem It also loads a source text file and runs an Anaplan import into a module.rem For details of how to configure this script visit https://help.anaplan.com/anapedia/Content/Downloads/DL_Downloads.html
set AnaplanUserfirstname.lastname@example.org:passwordset WorkspaceId="9a91b09b654f3db40265edc4a545651j"set ModelId="531EA37013264109D3C9F43D0C6368JV"set ServiceUrl="https://api.anaplan.com"set AuthUrl="https://auth.anaplan.com"
set Operation=-file "Test file.csv" -put "C:\path\Test file.csv" -import "Import name from Test file.csv" -executerem *** End of settings - Do not edit below this line ***
setlocal enableextensions enabledelayedexpansion || exit /b 1cd %~dp0if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser%set Command=.\AnaplanClient.bat %Credentials% -service %ServiceUrl% -auth %AuthUrl% -workspace %WorkspaceId% -model %ModelId% %Operation%@echo %Command%cmd /c %Command%pause
The only thing which you need to change here is your username:password, WorkspaceId, ModelId and file name with path. Nothing else. I have highlighted the things to change in bold letters.
If you run the above script, it will throw the result or error if any. If you get error on API, ensure you have the java installed on the system and api.anaplan.com is white listed in your firewall.
Hope this helps.