Sample batch file for process in Anaplan Connect

Highlighted
Master Anaplanner/Community Boss

Sample batch file for process in Anaplan Connect

Hi Community,

 

Has anyone got any sample batch files to hand for a process that includes a number of imports?

 

Many thanks,

 

Callum

6 REPLIES 6
Highlighted
Master Anaplanner/Community Boss

Re: Sample batch file for process in Anaplan Connect

HI @CallumW,

Here you go,

 

@echo off
set AnaplanUser="firstname.lastname@company.com"
set WorkspaceId="8a1234567897c12b014bf01234567890"
set ModelId="CB0A5A4D5C5943B5837FF42C5FAA95E1"
set Operation= -file "file1.txt" -put"C:\Files\ImportModule.csv" -file "file2.txt" -put "C:\Files\example.csv"
-process "myprocess" -execute  -output "C:\MyDirectoryForImportDumpFiles"
rem *** End of settings -Do not edit below this line ***
setlocal enableextensions enabledelayedexpansion || exit /b 1
cd %~dp0
if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser%
set Command=.\AnaplanClient.bat %Credentials% -workspace %WorkspaceId% -model %ModelId% %Operation%
@echo %Command%
cmd /c %Command%
pause

I hope this helps!

Regards,
Kavin.

 

Regards,
Kavin.
Highlighted
Master Anaplanner/Community Boss

Re: Sample batch file for process in Anaplan Connect

Hi @kavinkumar 

 

I am having issues with the authentication (Code 500, internal server error) also being prompted for the address instead of automatic.

 

In addition, if I have two actions that the same file, how do I present that in the script? -file "" -put"" -put"" or separate -file"" -put"" for each action.

 

Best,

 

Callum

Highlighted
Master Anaplanner/Community Boss

Re: Sample batch file for process in Anaplan Connect

HI @CallumW,

1. Please double-check your credentials, Workspace and Model Ids or check if the model is the live state (Not in the archived mode).

2. If the actions are using the same import file then there is no need for writing the script 2 times. Once the file hits the Anaplan, the data will be stored in 'Import Data Source' and no need to do the same activity again (-file "" -put"")

Regards,
Kavin.

Regards,
Kavin.
Highlighted
Master Anaplanner/Community Boss

Re: Sample batch file for process in Anaplan Connect

Hi @kavinkumar ,

 

Thanks for the info.

 

Unfortunately still having issues with authenticating (same error message) and have checked all ID's for consistency.

 

Ran an old import process with identical details and the API authenticated fine.

 

Any thoughts?

 

Best,

 

Callum

Highlighted
Master Anaplanner/Community Boss

Re: Sample batch file for process in Anaplan Connect

I should also note, my previous script was using 1.4.1 and my new one is using 1.4.3

Highlighted
Master Anaplanner/Community Boss

Re: Sample batch file for process in Anaplan Connect

*Update - ran the new script using the old API and I had the same 500 error.