Avoid creating empty export files
I have an export action triggered by Anaplan connect (export of POs)
So a file is created and placed in a folder, the ERP system then read from this file and creates POs in the ERP system.
This action runnes quite often and often the exported file is empty (only headers) so there is actually nothing to export. I would then prefer that the file is not created at all. How can I avoid creating files when there is nothing to export? Please help me figure this out.
Best Answer
-
All good with me! Hope you are well as well!
Unfortunately we can't make export action unavailable based on boolean. So will need that bit advanced modification of Anaplan Connect script. Probably starting with ChatGPT and question like "how to read cell b2 value from csv in windows batch script" would be good idea in addition in starting the script by exporting count of rows to be exported.0
Answers
-
Hi Caroline,
With bit of additional scripting and a count of rows to be exported in system module this would be possible within the Anaplan Connect. As first in a system module you would create count of rows to be exported. Then you would be modifying your Anaplan Connect script to read that count as first step and use exported value of that count line item as if statement in your Anaplan Connect script to determine if the main export should be run or not.0 -
Hi Pyry,
That is actually exactly what I hoped someone would answere.. Because when I suggested that solution to our "Anaplan Connect integration person" I got the answere that Anaplan Connect is not smart enought to make those decitions, that we are not able to write a script like that. I dont have much at all knowledge in Anaplan connect.. but I will search on how to modify the script.
Thank you Pyry hope you are fine by the way!!
1 -
And it is not possible in some way to make the export action to be avaliable only if an statement is True and in that way not modify the Anaplcn connect script?.. all the methods I have tested - with selective access/read access on the module.. still generats empty files
0 -
hi @CarolineJosefsson our project also meeted similar issue ,and there was really no good solution from Anaplan side .our Solution is still to export empty file even no data ,and update the script from the receiving end,if no data in file ,the script will not write into the third-part system ,the exported files are also as exported log .
hope it is helpful to you.
0 -
While it is true that AnaplanConnect is not smart enough to do that, AnaplanConnect is essentially just using Windows (or Linux) scripting to initiate an action of some kind in Anaplan — to feed or receive data, etc. Because of that, your developer would be able to write @pyrypeura's suggested logic in the appropriate scripting language to determine if the export should happen.
I wrote a blog post eons ago on setting up some methods of making complex AnaplanConnect integrations more manageable. There is a link at the top to a Windows Scripting language guide that could prove useful. Check it out! :)
0