HendrikDeCuyper
Frequent Contributor

Anaplan Connect - Put file gives Array Index Out of Bounds

Hi,

我有一些问题与我的安娜plan Connect scripts to import a file & run a process.

When trying to upload the file, I receive an error "Array Index Out of Bounds: 0".

When I run the process from the Anaplan website and import the same file there, it works perfectly.

When I run the script, using only the first 3 lines of the file as input file, the script also runs perfectly. My guess is that the issue is with the input file, but I cannot figure out what the problem would be.

clipboard_image_0.png

The input file is attached. Below you can also find a copy of the script:

@echo off
rem 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 visithttps://help.anaplan.com/anapedia/Content/Downloads/DL_Downloads.html

set AnaplanUser="userid:pw"
set WorkspaceId="workspaceID"
set ModelId="ModelID"
set ServiceUrl="https://api.anaplan.com"
set AuthUrl="https://auth.anaplan.com"
set FileName="ANA_Mat_Plant_Attr.csv"
set FilePath="...\ANA_Mat_Plant_Attr.csv"
set DumpName="dump/path/here"
set Chunksize=1

set Operation=-debug -service %ServiceUrl% -auth %AuthUrl% -workspace %WorkspaceId% -model %ModelId% -chunksize %Chunksize% -file %FileName% -put %FilePath% -process "Import SKU / Plant" -execute -output %DumpName%

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% %Operation%
@echo %Command%
cmd /c %Command%
pause

Thanks.

16 REPLIES16
khendrikz
Occasional Contributor

Do you want to run only an import action, or do you want to run a process that has the import action built in the process?
khendrikz
Occasional Contributor

I'd move "-chunksize %Chunksize%" after "-put %FilePath%"
HendrikDeCuyper
Frequent Contributor

Moving the chunksize part after the put did unfortunately not solve the issue. In my other scripts I follow the same logic & there it works smoothly.

HendrikDeCuyper
Frequent Contributor

Run an process which has an import embedded indeed, that's why I need to upload the file.

kboothe
Occasional Contributor

Did you ever get this figured out? I'm running into the same problem. This script is almost exactly like another one that is working perfectly, so it's really baffling me.

ankit_bhargava
Certified Master Anaplanner

Hello@kboothe

How is your source file delimitted is it similar to the other script's source file? One other item I would check is the chunk size when you are uploading to anaplan connect, it might be worth increasing it.

kboothe
Occasional Contributor

Hello@Ankit

非常感谢您ggestions. I think I may be getting close. Both source files are delimited with "|". I have increased the chunksize to 50, but I'm still getting the Array index out of bounds error. The problem does seem to be the source file though. It was 23K lines, so I deleted 8K and the error disappeared. I think I will try validating the data in the 8K . . . unless you have any other suggestions.

kboothe
Occasional Contributor

FYI to anyone else receiving the array index out of bounds error, I was finally able to resolve it by placing the chunksize after Modelid in the set operation (it was originally after the filename).

sean_culligan
Certified Master Anaplanner

I ran into this issue this week and raised a support ticket. The source of the error was the use of more than one delimiter in the file definition. This seems to be a known issue with Anaplan Connect V1.4.x.

To correct the issue update your file definition, Imports > Import Data Sources, and change delimiter selection so that you only use a single delimiter.