Type in the code below in the text area.Select Write script / Copy same function button.Click on Workflow button on the left sidebar.To create a function in Creator follow these steps: I’m reluctant to use the term table here because unlike other environments, in Creator each form represents both the visual and the data layer of each entity. By creating a form, the data storage mechanism behind it is also created. I assume you know how to create forms in Creator, but to make sure you have all the necessary fields for the deluge function to work, here is how the Products form should look like: A list of available products will be populated from Products to make sure employees are selling what is in stock. It collects order, customer, and products information. Add Order – This form allows users to place new orders.Our deluge script will pull the inventory every morning and update the list of products in this form. Products – This form contains the latest products available in stock.Step 3 – The Creator Appįor our little demo, we are going to create a simple app featuring 2 forms: If you need to access massive CSV files, you may need to change the code in the middleware. Note: Depending on the version of PHP on your web server, there is a memory limit to how big of a CSV file you can load up in one go. It should return the contents of the CSV file and display it in the browser similar to the following figure. Make sure you change the values in lines 5-7 and line 9 to reflect your server settings. On your local machine create a PHP file, ftp.php, and paste the code below in it. For this purpose we are going to use the good old PHP because it is easy to code and maintain and works on pretty much any web server. Note that you can’t store this in Creator and you will need to have access to a web server, such as where your company site is hosted. A sample file is shown below:įirst, we need to create the middleware and deploy it on a web server. Step 1 – The Data Fileīefore everything make sure you have the demo CSV file, inventory.csv, ready and uploaded to the FTP server. Now, a middleware can do way more than that, but for the purpose of our tutorial all it needs to do is to connect to the FTP server, load the CSV file, and send its contents back via a HTTP response. So the only solution is to create a small middleware that takes care of extracting data from the FTP server and sends it back to the Creator app. Placing private company data in a non-secure location is never recommended. For this purpose you need to either place the remote file(s) on a non-secure site, or use a middleware to extract data for you. Since getURL() can only send HTTP requests, connecting to a secure (password protected) FTP server is not directly possible. In our example, this data is CSV, but it could very well be JSON, or plain text. Solutionĭeluge offers getURL(), a function that allows apps to retrieve data from external sources using HTTP protocol. Your sales management app is no exception either and needs to import this CSV file every morning to have the updated product list available. Other software systems in the organization consume that file by importing it manually every morning. The only way this system can communicate with the outside world is via FTP.Įvery morning at 1:00AM EST the legacy system exports a list of all products and available stock to a CSV file and places it on company’s FTP server. The company uses a legacy inventory management system to keep track of all the goods and material available to sell. The app is working great and users are able to place orders and record each transaction. You have created a sales management app that keeps track of sales. You can use the code in this tutorial without changing anything other than the FTP url and account. We will also get some help from a PHP script, so some PHP knowledge is helpful too, but not necessary. Note: I assume that you are familiar with Creator and Deluge. In this post I’ll show you how to import data from an FTP server into a Creator app using a Deluge function and a little middleware. To take it even further there is a rather capable REST API to connect your app to the outside world. If you need more functionality you can always create custom functions and behaviours using the powerful Deluge scripting language. There is a rich toolset of UI elements, business logic components, and reporting tools to make your life easier. Manipulating data is a core capability of (Zoho) Creator. You can build simple apps in the matter of hours or have complex solutions up and running much quicker than a from-scratch project. Zoho Creator has grown to be a great cloud-based app creation platform.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |