What?
This is an article documenting how to send a Zoho Deluge Map request to an API which is expecting nested/2d/multi-dimensonal arrays. In the example below, we are posting to a PHP script for testing but I have since sent something similar to an API expecting nested arrays (not sure if they were PHP) and it works.

Why?
This took me several days and in the end only going through various forums and documentation, I found a solution which worked for me. Note that usually I could customize the receiving PHP script to receive a JSON request and process it that way but my usage was to send data to a Third-Party API over which I had no control.

What I need to send to the 3rd-party API:
{
  "auth": {
    "secret": "can_you_keep_a_secret",
    "key": "aaabbbbccccddddeeeeffff11112222"
  },
  "data": {
    "member_id": "123456",
    "channel_name": "shopify",
    "item_name": "Joel's Awesome Life",
    "item_price": "priceless"
  }
}
What Zoho sends to the 3rd-party API:
Sending a map request using the invokeUrl() function, the odd thing is that Zoho's request adds double-quotes to the request and escapes the other double-quotes sending something like this:
{
  "auth": "{\"secret\": \"can_you_keep_a_secret\",\"key\":\"aaabbbbccccddddeeeeffff11112222\"}",
  "data": "{\"member_id\": \"123456\",\"channel_name\": \"shopify\",\"item_name\": \"Joel's Awesome Life\",\"item_price\": \"priceless\"}"
}
What I have in Deluge
m_Auth = Map();
m_AuthSub = Map();
m_AuthSub.put("secret","can_you_keep_a_secret");
m_AuthSub.put("key","aaabbbbccccddddeeeeffff11112222");
m_Auth.put("auth",m_AuthSub);
m_Data = Map();
m_DataRecord = Map();
m_DataRecord.put("member_id","123456");
m_DataRecord.put("channel_name","shopify");
m_DataRecord.put("item_name","Joel's Awesome Life");
m_DataRecord.put("item_price","priceless");
m_Data.put("data", m_DataRecord);

How?
So this is more of an annoyance then an impossible task... because it is possible, the technique above is simply wrong. The trick and solution is a lot simpler than you might think...

What?
This is an article to demo some Deluge code on how to download a file that was uploaded in CRM in a custom module in field that was of type "File Upload".

Why?
Just to remind me where I went wrong, I have a client with ZohoCRM who upload a PDF (can be any file but is usually a PDF) to a custom module in their CRM; I then need the customer from the customer portal in a ZohoCreator app to be able to download this file.

How?
The trick to doing this is that actually

What?
This is a quick article to template some code to me on sorting a map variable in Zoho Deluge, specifically Zoho Creator.

Why?
I do this a lot but in the following example, I want to sort a list of records by their date in descending order. Yes this functionality exists in reports but I want to do it in code so as to display it in a HTML table.

What I have:
id      name        date
---------------------------------------------
46498   Joel        1977-11-14T12:30:00+00:00
8949    Anonymouse  1923-10-16T15:00:00+00:00
335448  Amazing     1997-07-05T23:15:00+00:00
What I want:
id      name        date
---------------------------------------------
335448  Amazing     1997-07-05T23:15:00+00:00
46498   Joel        1977-11-14T12:30:00+00:00
8949    Anonymouse  1923-10-16T15:00:00+00:00

How?
So to give you a gist of what the following snippet of code is doing, let me give an overview:
  1. Build up a map with sample data (you won't need to this, use your own data, this one is for this demonstration only)
  2. Initialize a list to hold the keys which we will use to sort in ascending/descending order and a map created to hold all the records.
  3. Loop through the sample map to create the new map we can sort as well as to add keys to the list declared previously.
  4. Sort the list of keys in ascending/descending order.
  5. Loop through the list of keys, retrieving each record

What?
A very quick article on converting a Map string into a HTML table without using a for each loop.

Why?
I have quite a big response from our CRM that hits a statement execution limit if I use a for loop. I have a map with 3 columns: first_name, last_name, and ID. What I want is a HTML table now with the headers and data but without using a for loop.

What I have:
{"First_Name":"Joel","Last_Name":"Lipman","id":"1"},{"First_Name":"Another","Last_Name":"Person","id":"2"}
What I want:
First NameLast NameID
JoelLipman1
AnotherPerson2

How?
This is a bit of a dirty solution and as long as "id" is not your first column (because "id" can be found in names like "David") it will work.

What?
This article documents how to stop an employee from applying for leave when already 80% of their team have already booked the same date off.  My brief was:

  • Check the department this employee belongs to
  • Search for employees of the same department (team members) who have booked the same days off (ie count holiday clashes)
  • Prevent an employee for applying for leave if over 80% of the department have already booked the requested dates off.

In other words, if there are 10 people in a department/team, and 8 people have booked tomorrow off, prevent a 9th team member booking tomorrow off.

Why?
I've written this article as it took a while to achieve. The Zoho People application and its API are documented but there are problems with the documentation at the time that this article was written. One is that there are 2 sets of documentation and the other is that the majority of the documentation doesn't refer to OAuth 2.0/json and instead uses the deprecated authtoken v1 and XML.

How?
The trick in this solution was more about the process and what that process was.

What?
The aim of this article is to document how you can display a Creator report to the user, that they can select (tickbox) multiple records in that report, and then have a button that loops through all the selected (ticked) records. The example below documents a report of Quotes where we want to merge all the product line items of each quote into one single quote.
Zoho Creator - Report Multiple Records Selected
Why?
I've written this article because I keep forgetting on how to do this. I have a specific order of steps on how I do this, you may find other ways but this is one that works for me.

How?
So here's an overview and then we'll go into more detail:
  1. Create a function that accepts a form of records
  2. Create a workflow that understands the function parameters

Related Articles

Joes Revolver Map

Joes Word Cloud

license   date   program   parameter   site   script   files   value   page   source   version   find   code   data   system   content   html   following   copy   list   website   could   report   added   zoho   table   need   first   mysql   google   using   name   file   select   server   joomla   error   time   database   uploaded   would   note   user   display   used   where   search   windows   work   solution   JoelLipman.Com

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate
© 2021 Joel Lipman .com. All Rights Reserved.