Hi every one just want to share about process with you.. I just want to share my code to build JSON string in DELUGE.
As the api is not as complete as javascript.. we need to have tricks.. For myself i have 1rst try to use the combination of Map(); and List(); with toString(); function to build the perfect JSON Map but it was realy a long script, difficult to read.. so now i just concatenate string or part of string...
Its important to create json string instead of pure json as square Bracket List "[0,1,2,..]" is not supported and will be squish into curly brace "{}" on save.
Exemple : THIS
- {
- "metaApiName": "contract-end-date",
- "inputs": [
- {
- "inputApiName": "contract-end-date",
- "inputValue": 3
- },
- {
- "inputApiName": "n-monthsyears-value",
- "inputValue": "contract_month"
- },
- {
- "inputApiName": "n-monthsyears-term",
- "inputValue": 0
- }
- ]
- }
- will become this on save wich is incorrect
- {
- "metaApiName": "contract-end-date",
- "inputs": {
- {
- "inputApiName": "contract-end-date",
- "inputValue": 3
- },
- {
- "inputApiName": "n-monthsyears-value",
- "inputValue": "contract_month"
- },
- {
- "inputApiName": "n-monthsyears-term",
- "inputValue": 0
- }
- }
- }
So thirst thing i suggest is build the entire request in json an then passing it as string with escaped caracters as bellow
- jsonString = "{\"metaApiName\":\"contract-end-date\",\"inputs\":[{\"inputApiName\":\"contract-end-date\",\"inputValue\":3},{\"inputApiName\":\"n-monthsyears-value\",\"inputValue\":24},{\"inputApiName\":\"n-monthsyears-term\",\"inputValue\":0}]}"
Then you can split the request string in parts and build the full request string with
- string = "3"
- string += "2"
- string += "3"
- info string; = "123";
, add variable with + operator and the outpout will be correct.
InnerArrayVaraibleSTRING = "{\"inputApiName\":\"contract-end-date\",\"inputValue\":3},";
- InnerArrayVaraibleSTRING += "{\"inputApiName\":\"n-monthsyears-value\",\"inputValue\":24},";
- InnerArrayVaraibleSTRING += "{\"inputApiName\":\"n-monthsyears-term\",\"inputValue\":0}";
jsonString = "{\"metaApiName\":\"contract-end-date\",\"inputs\":[ " + InnerArrayVaraibleSTRING + "]}";
And bellow the full exemple to build the map of a contract :
- TypeDeContrat = "you-contract-type-id"; // Contract type id = url part of edit contract type
- contrat_title = "Contrat Test 2024 Auto"; // Contract title
- requester = "NAME OF REQUESTER";
- contrat_description = "Description of the contract";
- CounterpartNAme = "ACCOUNT-ID-IN-ZOHO-CONTRACT";
// Counterpart id = url part id of counterpart
// (exemple : green veggy society is certainely : green-veggy-society ) - counterpartUserNAmeMAil = "COUNTERPART EXISTING CONTACT EMAIL";
- contract_month = 36; // the duration of my contrat // this one start with sign for contract_month ;
- //Contract map title and template
- contrat_content = "{\"metaApiName\":\"contract-type\",\"inputs\":[{\"inputApiName\":\"contract-type\",\"inputValue\":\""+ TypeDeContrat +"\"}]},{\"metaApiName\":\"title\",\"inputs\":[{\"inputApiName\":\"title\",\"inputValue\":\""+ contrat_title + "\"}]},{\"metaApiName\":\"description\",\"inputs\":[{\"inputApiName\":\"description\",\"inputValue\":\""+ contrat_description + "\"}]},";
- //Contract map asker
- contrat_content += "{\"metaApiName\":\"requester-name\",\"inputs\":[{\"inputApiName\":\"requester-name\",\"inputValue\":\""+ requester + "\"}]},";
- //Contract map counterpart
- contrat_content += "{\"metaApiName\":\"party-b-name\",\"inputs\":[{\"inputApiName\":\"party-b-name\",\"inputValue\":\""+ CounterpartNAme + "\"}]},{\"metaApiName\":\"counterparty-primary-contact\",\"inputs\":[{\"inputApiName\":\"party-b-primary-contact-name\",\"inputValue\":\""+ counterpartUserNAmeMAil + "\"}]},";
- contrat_content += "{\"metaApiName\":\"contract-term\",\"inputs\":[{\"inputApiName\":\"contract-term\",\"inputValue\":true}]},{\"metaApiName\":\"is-renewable\",\"inputs\":[{\"inputApiName\":\"is-renewable\",\"inputValue\":false}]},{\"metaApiName\":\"contract-effective-date\",\"inputs\":[{\"inputApiName\":\"contract-effective-date\",\"inputValue\":1}]},";
- //Contract map Basic Options i selected (start with signature for x month )
- contrat_content += "{\"metaApiName\":\"contract-end-date\",\"inputs\":[{\"inputApiName\":\"contract-end-date\",\"inputValue\":3},{\"inputApiName\":\"n-monthsyears-value\",\"inputValue\":" + contract_month + "},{\"inputApiName\":\"n-monthsyears-term\",\"inputValue\":0}]}";
- // concatenate all input field list in brackets
- inputfieldlist = "[" + contrat_content + "]";
- // Finaly add anythings to the final json array map
- input_contract_map = "{\"externalSource\": true, \"inputfields\":" + inputfieldlist + "}";
//Show and debug the array maps generated- info input_contract_map;
You can notice the formula :
\"inputValue\":\""+ contrat_title + "\" , where contrat_title = "string_variable";
double quote is escaped before string and variable concatenation to ensure string variable to appear as string..
as "inputValue": " + contrat_title + " ,
become "inputValue": "string_variable " ,
Then you just have to put it to add it to the request :
- headerMap = Map();
- headerMap.put("Content-Type","application/json");
- //GET ZOHO CONTRACT EXEMPLE
- // CREATE THE CONTRACT
- //url :"https://contracts.zoho.eu/api/v1/createcontract" // create with subfields
- response_create_contract = invokeurl
- [
-
- url :"https://contracts.zoho.eu/api/v1/contracts"
- type :POST
- parameters: input_contract_map
- headers:headerMap
- detailed:true
- connection: "YOUR_CONNEXION_NAME"
- ];
- info response_create_contract;
If you have better way to ensure good encoding of the JSON string please comment and share !
Recent Topics
Meta and Facebook data report discrepancy
I have been currently gathering manually facebook follower data thru meta. In zoho marketing plus the social media reporting only allows for page likes, and so there is a discrepancy with the data. please the difference in files attached. Is there way
Links in Instagram
Hi there, I have been using Later for a while now but keen to come back to Zoho Social as Later doesn't offer tagging of pages on Facebook but they offer something Zoho doesn't. You can add a link to your bio which opens up your profile feed where images
If I turn off the Task Prefix & ID in the Portal Configuration section, will it remove the dependencies in my projects?
Hi all, basically the title, I am new to zoho projects and trying to get my head around some basic principles. Unfortunately I have not found this information via the search option and after deleting yesterday some Phases I had created in the Phases tab,
Enter dates in tasks with just "tue" or "+10" or "5d" ???
Is there any way to enter due dates in tasks without typing the whole date or making time consuming clicks in the calendar? I don't see anything online in the help or third party videos.
Multiple time zones in zoho projects
We are working in an international team. We need to set up different time zones in the organizational settings or at least for one project within zoho projects. Any ideas or help? Thx in advance
Zoho Desk : Field for 'Layout'
I have many different layouts on my helpdesks and I want to be able to identify the stats for each one, however I can not find the field in the raw data from the Zoho Desk datasource. I thought it might be in the "Tickets" table but there is nothing.
Customize Zoho One Dashboard and URL?
Hi everyone, Is there a way to customize my Zoho One URL to be different from the default portal URL? The current portal URL is: one.zoho.com/zohoone/[organization] I want to map it to its own standalone domain that we own. eg) domain.com instead of one.zoho.com/zohoone/[organization]
Enable Sending Direct Messages to Self in Zoho Cliq
Hi, I would like to request a feature enhancement for Zoho Cliq to allow users to send direct messages to themselves. Currently, Zoho Cliq does not have the option to send a direct message to oneself. While creating a channel with just one member (the
JOB Sheet can not send PDF as service rapports and more info needed other topic
Goedendag, - Jullie hebben nu job sheet erin gedaan en dar is echt super goed, enkel kunnen we de werkbon ( JOB sheet) nu niet verzenden als PDF als een service rapport naar onze hoofdaannemer hoe we dat nu doen als bewijs van de levering van het werk
Tax Deduction at Source (TDS)
I issued a sale invoice outside UAE , the customer apply TDS on the invoice , i checked my Zoho ( professional version ) i couldn't find the option of Enable TDS to let it appear while posting the incoming payment , please how to make it and how to configure
UNAPPROVED record management
When the unapproved list of duplicates is long, one needs the some tools to manage them - when this list has over 1500 records, we cannot manage it without some tools, such as: 1. The ability to apply a filter - ie similar to creating a CREATE a NEW VIEW
Zoho mail filter Add to WorkDrive doesnt't work
Hello, We have a problem with using the filter in the email. So, we want that when a bulk payment confirmation from the online store arrives, this email is automatically saved in HTML format on the drive using the action 'Add to Zoho WorkDrive -> Email
Introducing Zia GenAI: Zoho's Native Generative AI for Zoho Desk
Hello everyone, Zia GenAI is available on Early Access for Zoho Desk Enterprise subscribers. Kindly fill out this Registration Form to request early access. We are excited to announce the Beta release of Zia GenAI in Zoho Desk, now available through our
Add blueprint buttons to listview and kanban
Hello, just started to use the Blueprints feature - really useful. I have one suggestion to help this work even better - can there be transition buttons that appear on the top of listview & Kanban? Maybe an option as well - "Blueprint transitions appear
Deleted message in SPAM
In one of my gmail accounts (getnickifit@gmail.com) I had an email from PayPal in the SPAM folder. I thought I was moving the message to the inbox from the zoho mobile but it looks like it was deleted. It is no where to be found--inbox, trash, etc. Can it be restored?
CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive
Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
Multiple Facebook Pages under Single Brand
Hi everyone, I'd like to know if there is a possibility of connecting multiple Facebook pages under a single brand on Zoho? At the moment, there are different Facebook pages of a single brand and would want to keep under the same brand on Zoho as we
Zoho Books Estimate to Zoho CRM quote?
I'm not sure why this isnt automatic, but maybe I'm missing something. When we create a quote in zoho books we have a custom function that pushes the contact into a deal within the CRM. I can not for the life of me figure out how to push an estimate from
Zoho Developer Hangout (ZDH) – Episode 17 | Optimizing Organizational Processes through Automation
Hey developers! Running a business can get quite overwhelming especially when juggling multiple tools like those in the Zoho ecosystem. Although integrating most of them is a piece of cake, manual intervention is needed at times. Being able to automate
Apple Messages for Business in Omnichannel communications?
Hello, Apple launched "Apple Messages for Business" but Zoho CRM or Zoho Desk don't appear in the list of possible integrators. Zoho already promotes https://www.zoho.com/crm/omnichannel.html Omni Channel integration, but Apple Messages does not yet appear.
Kaizen #140 - Integrating Blog feed scraping service into Zoho CRM Dashboard
Howdy Tech Wizards! Welcome to a fresh week of kaizen. This week, we will look at how to create a dashboard widget that displays the most recent blog post of your preferred products/services, updated daily at a specific time. We will leverage the potential
Schedule meeting monthly on a particular day
Suppose I wanted to schedule HR meeting every month on the first Tuesday with each employee separately for 20 minutes each. How could I automate these type of meetings? And if Sunday occurs on the first Tuesday I would like to shift that meeting on next
In ZohoCRM Dashboards - Editing Shown Columns on Drilldown of Components
Hello! I'm working with some Dashboards inside of ZohoCRM. When creating a component (In this case, specifically a KPI Ranking Component), I'd like to customize which fields show when trying to drilldown. For example, when I click on one of the sales
Added Domain but SSL is not being set properly
We added a Domain for our landing page and it pushed an SSL cert to it. The Cert is generated by LetsEncrypt, but it doesn't match our subdomain (i.e., it's just pointing to zohosites.com). How do we get the cert properly setup there?
Zoho CRM Widget not displaying 2 related lists (JS)
Okay so I basically have 2 relatedLists that I want to get and render: ZOHO.CRM.API.getRelatedRecords({ Entity: data.Entity, RecordID: data.EntityId, RelatedList: "Notes", page: 1, per_page: 200, }) ZOHO.CRM.API.getRelatedRecords({ Entity: data.Entity,
KPI widget with percentage
I'm trying to create a KPM widget that displays current performance as a percentage - something like the picture below. I've tried following the instructions at https://www.zoho.com/analytics/help/dashboard/kpi-widgets.html#chart but nothing ends up being
Canvas List View Not Saving
Hi, I am trying to edit a list view to look different depending on the tags. Everything worked well and saved well with multiple views, but when I have gone back in to make some small changes like moving one of the icons it comes up with the error message
QR code image is not exported in PDFs
The new QR code field works fine when I include it in a report template and I choose the print option: https://creatorapp.zoho.com/<username>/<app_link_name>/record-print/<report_link_name>/<record_ID>/ But when I try to save the document to a .pdf file
QR codes in templates
I'm excited about the new QR code generator. I have included a QR code that contains the record ID setting "${ID}" as input data. In the report detail it works perfectly but when printing it in a template the code is not shown.
This mobile number has been marked spam. Please contact support.
Hi Support, Can you tell me why number was marked as spam. I have having difficult to add my number as you keep requesting i must use it. My number is +63....163 Or is Zoho company excluding Philippines from their services?
Zoho CRM search not working
The search bar is not showing any results in our CRM installation. We have a lot of items and can not search them by using the navigation each time. Can someone please check this asap.
Reload page with widget
Hi all, I hope I can find some help here. I developed a small widget for Creator that is integrated into a page as a component. The page contains other content as well. When the widget is sent, the entire page should be reloaded to apply the changes to
Tip of the week #37 - Manage all your Telegram business conversations directly from your shared inboxes.
Tired of switching between multiple apps to manage your business conversations? With Zoho TeamInbox's multichannel inboxes, connect your Telegram channel to a shared inbox. This way, your teams can easily handle c View, reply, and collaborate on them
Tags on notes aren't syncing correctly on Android
I've created notes on the desktop version that have several tags assigned, but on both my Android devices those notes only have ONE of those tags instead of all of them, despite the actual content of the note being correctly synced, and I'm also starting
Reports - custom layout - duplicate report
Do you also have this problem and what is the possible solution? I duplicate a report that has a "custom layout". Unfortunately the custom layout is not duplicated. To be improved for a future release by Zoho. I export the custom layout and import it...
How to map a global picklist from one module to another
Hi there, i currently have a new field that is called sales office which we use for permission settings between our different offices located in different countries. It is a global set picklist with three different options: MY, SG and VN. I want to be
Pageless mode needed to modernise Writer
When we switched from GSuite to Zoho, one of the easiest apps I found to give up, was Docs. In many ways, Writer has always been more powerful than Docs, especially in terms of workflows/fillable forms/etc. However, I went back into Docs because I notice
Changing the Logo Size on Zoho Sites
My company logo incorporates both an image and text, and I would like it to be much more prominent on the page than is currently allowed by the small logo box in the template. Is there any way to hide the page name and then make the logo box much bigger since my company name and logo are connected / are all in one file? Thank you.
Is it possible to Select Item Serial Numbers from a Sales Order?
Our accepted estimates are converted to Sales orders for our warehouse staff to pick. How can my warehouse staff select the serial numbers for an item when editing a Sales Order? Logically when staff pull an item and have the serial in front of them they update the Sales Order and select the serial. I understand a serial can be added when creating an invoice but how can accounts team know the serial if the warehouse staff can't select it! A basic flaw!
MORE BUGS: Client Script, Deluge and Widget JS SDK don't work as expected when trying to retrieve a record that has been "rejected" as part of an approval process.
Client Script $Page.record is null when accessing a record that has been "rejected" as part of an approval process. Deluge zoho.crm.getRecordById(moduleName, recordId) returns {"status":"failure"} when recordId is a valid, but rejected record. OK... I
Next Page