API: Running a process

Contributor

API: Running a process

So if I have created a process that I use via  a dashboard button.

Step 1: clears a list

Step 2: The file to upload selection is available

Step 3: You choose the file

Step 4: You hit run

 

The process runs manually without issue.

 

If I use the Anaplan Connect, I created a .bat file and can trigger this process and it apparently works just fine, but I am NOT having to select a file.

 

What do I need to do when I run this process?

 

Do I need to create an Import of the file as a first .bat and THEN run the process?

Or do I define the file and file path that the process uses?

 

The following is my script...minus removing any identifying Parameters:

@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 visit https://help.anaplan.com/anapedia/Content/Downloads/DL_Downloads.html

set AnaplanUser="USERID:Password"
set WorkspaceId="WorkspaceID"
set ModelId="ModelID"
set ServiceUrl="https://api.anaplan.com"
set AuthUrl="https://auth.anaplan.com"
set File="CY_GROWER_ANAPLAN_IMPORT.csv"
rem set Put="C:\QlikDev\Anaplan\Templates\CY_GROWER_ANAPLAN_IMPORT.csv" -put %Put% -File %File%
rem set Action="IMPORT_CY_GROWER_ANAPLAN_IMPORT.csv" -action %Action%
set Action="CY Grower Orders Update"

set Operation=-service %ServiceUrl% -auth %AuthUrl% -workspace %WorkspaceId% -model %ModelId% -process %Action% -execute -output "ERROR PATH" - Do not edit below this line ***

rem set Operation=-debug -service %ServiceUrl% -auth %AuthUrl% -workspace %WorkspaceId% -model %ModelId% -P

 

setlocal enableextensions enabledelayedexpansion || exit /b 1
cd %~dp0
if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser%
set Command=.\AnaplanClient.bat -d -d %Credentials% %Operation%
@echo %Command%
cmd /c %Command%
pause

 

 

3 REPLIES 3
Community Boss

Re: API: Running a process

Firstly, it is not good practice to clear a list each time prior to re-loading.  Using a defined key in the data to create a code for the list removes the need for this

 

But to your issue, the AC script is effectively like running the action directly from the actions tab rather than a dashboard so there is no prompt.  

You can run the import and load in one script.  The -file defines the name of the file and the -put loads this onto the cloud.  you can then run the import or the process using -import or -process

I hope this helps

David

Message 2 of 4
Contributor

Re: API: Running a process

Understood on the clear...the process was inherited by me and we have discussed removing it for the reason you described.

So to be literal.

In one script, I set operation to import the file

Then I can run the process that loads the file INTO the list?

Just importing the file makes a new file available to perform the ‘Load into List’ action?
Message 3 of 4
Highlighted
Expert

Re: API: Running a process

You need to use -put <local path> in the command line to upload fresh data before running any import or process. Before you use -put, specify the file data source in the model using -f.

 

Message 4 of 4