Message Boards Message Boards

CloudObject[ ], Get[ ] and Delete[ ] file: more elegant solution?

Posted 2 years ago

Hello

I am doing some calculation on products we sell in our catalog. My code is really simple and basically uses the Nearest function to find the closest part number that a customer is asking to quote from a list of our product catalog. I was planing to do everything on Wolfram Cloud but as we have an incredible amount of products the program takes forever to load the tables and find the part numbers so I decided to run it on my PC and have Mathematica look for a file when the user uploads a list with incorrect part numbers.

Right now it is working, I have a first line with

While[Get[CloudObject["Test"]] == $Failed, 
 Pause[10]] 

(Then the code) and at the end

Delete[CloudObject["Test"]]

In this way the program stays in the first line trying to find the file forever until the user feeds the file via a CloudDeploy[FormFunction........]

However when I run the program Mathematica outputs

CloudObject::cloudnf: No CloudObject found at the given address

Which is true and should be because there is no file in there until the user feeds it. Once the file gets in the location the program starts and process everything nice. I was wondering if there is a way to get rid of this output, or if there is a more "elegant" way to trigger the start of the program.

Thank you very much for your ideas.

Regards,

Rodrigo

POSTED BY: Rodrigo Amor
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract