Anaplan Connect - Export Script

Highlighted
Master Anaplanner/Community Boss

Anaplan Connect - Export Script

Hi,

 

I am getting the following error, followed by a list of options in my CMD window when i run my batch file.

 

My batch file is as follows (minus credentials and export names);

 

@echo off
Set AnaplanUser="Username:Password"
Set WorkspaceId="XXX"
Set ModelId="XXX"
Set Operation=-export "XXX" -get "XXX"
rem *** End of setting - 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

 

This is my error message:

 

Running Anaplan Connect...
Using Class-Path: C:\Users\XXX\Downloads\anaplan-connect-1.4.1\anaplan-connect-1.4.1-jar-with-dependencies.jar
2019-07-19 15:42:29 ERROR 16992 |-- Options are:

 

And the list goes on with a huge list of options.

 

Any help would be much appreciated.

 

7 REPLIES 7
Highlighted
Community Boss

Re: Anaplan Connect - Export Script

Are you missing a space between -model and %ModelId%?

Also, don't forget to use -execute if you want to run the export before downloading the result.

Highlighted
Master Anaplanner/Community Boss

Re: Anaplan Connect - Export Script

Can you also trying adding an -execute before your -get command?

Highlighted
Master Anaplanner/Community Boss

Re: Anaplan Connect - Export Script

Thanks both, I am now being asked for an Auth URL, is there a way to default this?

 

 

Highlighted
Master Anaplanner/Community Boss

Re: Anaplan Connect - Export Script

Assuming you are using the 1.4 API, add in:

 

-service "https://api.anaplan.com" -auth "https://auth.anaplan.com" after set operation= 

Highlighted
Master Anaplanner/Community Boss

Re: Anaplan Connect - Export Script

That is great - thank you!

 

All working perfectly now.

Highlighted
Not applicable

Re: Anaplan Connect - Export Script

Hi,
@echo off
set AnaplanUser="XXX:XXX"
set WorkspaceId="XXX"
set ModelID="XXX"
set Operation= -service "https://api.anaplan.com" -auth "https://auth.anaplan.com" -export "AMPS Export - Copy - Data.txt" -execute -get "C:\Output.txt"
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
This is my script to run export action. but the error I am facing is ''Using Class-Path: C:\anaplan-connect-1.4.1 (2)\anaplan-connect-1.4.1-jar-with-dependencies.jar
\lib\%l was unexpected at this time.''

Please give me some suggestions to fix this.

Highlighted
Not applicable

Re: Anaplan Connect - Export Script

Current Java version is valid for Anaplan Connect.
Running Anaplan Connect...
'Using Class-Path: C:\anaplan-connect-1.4.1 (2)\anaplan-connect-1.4.1-jar-with-dependencies.jar
\lib\%l was unexpected at this time.' - Exact error which I am facing