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 [1;31mERROR[0;39m [35m16992[0;39m |-- Options are:

 

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

 

Any help would be much appreciated.

 

Best Answers

  • ben_speight
    Answer ✓

    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.

  • jnoone
    Answer ✓

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

Answers

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

     

     

  • Assuming you are using the 1.4 API, add in:

     

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

  • That is great - thank you!

     

    All working perfectly now.

  • 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.

  • 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

  • Hi,

    Did you manage to solve this?

    I have exactly the same issue.

    Thanks!