[Resolved] Add rows in subform with Excel / Sheet datas

[Resolved] Add rows in subform with Excel / Sheet datas

Hi!

I'm trying to build an application where I can choose an Excel / Sheet file from a Workdrive folder, and for each data in the file, I create a row of a subform.

But I can't do it, here is the code I have:

  1. inputString = input.choose_xls_file;
  2. separatorIndex = inputString.indexOf(" - ");
  3. if(separatorIndex != -1)
  4. {
  5. getItemId = inputString.substring(separatorIndex + 3);
  6. getFileName = inputString.subString(0,separatorIndex);
  7. }
  8. queryData = Map();
  9. response = zoho.sheet.getSheets(getItemId,"creatorcon");
  10. worksheetNames = response.get("worksheet_names");
  11. worksheetName = "";
  12. for each  worksheet in worksheetNames
  13. {
  14. worksheetName = worksheet.get("worksheet_name");
  15. worksheetId = worksheet.get("worksheet_id");
  16. }
  17. responseV2 = zoho.sheet.getRecords(getItemId,worksheetName,queryData,"creatorcon");
  18. // info responseV2;

  19. if(responseV2.get("status") == "success")
  20. {
  21.     recordsList = responseV2.get("records");
  22.     if(recordsList.size() > 0)
  23.     {
  24.         firstRecord = recordsList.get(0);
  25.         input.project_name = firstRecord.get("Projet");
  26.         input.customer_name = firstRecord.get("Nom du client");

  27.         // Créer une liste pour les nouvelles lignes du sous-formulaire
  28.         newSubform = List();
  29.         
  30.         // Boucle sur les enregistrements pour ajouter chaque ligne au sous-formulaire
  31.         for each record in recordsList
  32.         {
  33.             // Créer une nouvelle Map pour chaque ligne
  34.             subformRow = Map();
  35.             
  36.             // Ajouter les données de chaque champ dans la ligne (Map)
  37.             subformRow.put("nom_materiaux", record.get("Nom matériaux"));
  38.             
  39.             // Vérifier et affecter la quantité
  40.             quantiteStr = record.get("Quantité matériaux");
  41.             if(quantiteStr != null && quantiteStr.isNumber()) 
  42.             {
  43.                 subformRow.put("quantite_materiaux", quantiteStr.toLong());
  44.             }
  45.             else
  46.             {
  47.                 subformRow.put("quantite_materiaux", 0);  // Valeur par défaut si non valide
  48.             }
  49.             
  50.             // Vérifier et affecter le prix unitaire
  51.             prixStr = record.get("Prix unitaire matériaux");
  52.             if(prixStr != null && prixStr.isNumber()) 
  53.             {
  54.                 subformRow.put("prix_unitaire_materiaux", prixStr.toDecimal());
  55.             }
  56.             else
  57.             {
  58.                 subformRow.put("prix_unitaire_materiaux", 0.0);  // Valeur par défaut si non valide
  59.             }
  60.             
  61.             subformRow.put("type_materiaux", record.get("Type matériaux"));
  62.             
  63.             // Ajouter cette ligne (Map) à la liste des lignes du sous-formulaire
  64.             newSubform.add(subformRow);
  65.             
  66.             info "subformRow : " + subformRow.toString(); // Afficher la ligne du sous-formulaire
  67.         }

  68.         // Assignation de la liste de Maps au sous-formulaire
  69.         // input.subform_materiaux = newSubform;
  70.     }
  71. }

If I decomment this :

I have this error :

Thanks for your help :)



        • Recent Topics

        • Rename Service Report

          Some of our customers are requesting the name of the service report PDF to be in a specific format, for example, instead of REP-001.PDF some are requesting to include their name like customername.pdf. is that possible?
        • Smarter holiday planning with yearly-specific Holiday Lists

          Hello everyone! Managing holidays and business hours is now easier and more efficient. Holiday Lists now support holidays that fall on different dates every year, while business hours now supports more than one holiday list. This helps businesses manage
        • AI Search and Record Retrieval Inside Zoho Creator – Is This Possible?

          Is it possible to integrate an AI assistant into Zoho Creator that can intelligently search, retrieve, and analyze records within the application’s forms and reports? Can AI access and query existing Creator data securely using Deluge or APIs to provide
        • Scheduled AU Data Center Database Version Upgrade for Zoho Forms

          Dear Zoho Forms' users, We would like to update you on a scheduled AU Data Center database version upgrade for Zoho Forms. Find the schedule below: Migration window: Sunday, 22nd February 2026 12.00 AM to 12.30 AM AEDT This migration is a part of our
        • Cannot get code to work with v2.mergeAndStore!

          Please can someone help me pass subform items into a repeating mail merge table row using v2.mergeAndStore? I have a mail merge template created in Writer and stored in Workdrive. This template is referenced by a custom CRM function which merges all of
        • Hotmail is blocking the zoho mail IP

          Greetings, Since last Tuesday (5 days ago today) I wrote to Zoho support and I still haven't received a single response (Ticket ID: 2056917). Is this how you treat people who pay for your email service? I am making this public so that those who want to
        • Zoho Bookings and Survey Integration through Flow

          I am trying to set up flows where once an appointment is marked as completed in Zoho Bookings, the applicable survey form would be sent to the customer. Problem is, I cannot customise flows wherein if Consultation A is completed, Survey Form A would be
        • Zoho CRM Community Digest - December 2025 | Part 2

          Hello Everyone! During the final weeks of December, Zoho CRM introduced updates that not only enhanced product capabilities but also offered deeper guidance through Kaizen posts. This section highlights what was released and shared in the last two weeks
        • CRUD actions for Resources via API

          Hello, is it possible to perform CRUD actions through the API for Resources? We want to create a sync from Zoho CRM Car record to Bookings resources to create availabilities for Car bookings. For Test drives, not only the sales person needs to be available,
        • Kaizen #186 : Client Script Support for Subforms

          Hello everyone! Welcome back to another exciting Kaizen post on Client Script! In this edition, we’re taking a closer look at Client Script Support for Subforms with the help of the following scenario. " Zylker, a manufacturing company, uses the "Orders"
        • Unable to Assign Multiple Categories to a Single Product in Zoho Commerce

          Hello Zoho Commerce Support Team, I am facing an issue while assigning categories to products in Zoho Commerce. I want to assign multiple categories to a single product, but in the Item edit page, the Category field allows selecting only one category
        • オンライン勉強会のお知らせ Zoho ワークアウト (2/19 参加無料)

          ユーザーの皆さま、こんにちは。コミュニティチームの中野です。 2月開催のZoho ワークアウトについてお知らせします。 今回はZoomにて、オンライン開催します。 ▶︎参加登録はこちら(無料) https://us02web.zoom.us/meeting/register/6AyVUxp6QDmMQiDGXGkxPA ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目指すイベント「Zoho
        • doubts about customer happiness in zoho desk

          Good afternoon, Desk community. The reason for my message is that I have a question regarding the customer satisfaction surveys we can ask our clients to rate our service. I know that in Desk, you can activate Customer Happiness to send a survey to the
        • COQL API in JS Widget only pulling 200 records

          Hello! We've been building a custom homepage widget using the Zoho JS SDK, and it seems that this https://help.zwidgets.com/help/latest/ZOHO.CRM.API.html#.coql only allows 200 records. I thought the limit was 2000 for COQL queries, but am I mistaken?
        • Standard Description Field - Can I change label or add dd tooltip

          Is there a way fo you guys to allow the customer to change the label name for the description field in the customer portal when submitting tickets. Or at least allow us to add a tooltip to clarify what description we need from them. I know I can create my own separate multi line description field but if I do that, it doesn't have the nice toolbar with Bold, Italic, Underline, color, font, indent, etc. Can you please allow us to add a tooltip to the zoho standard description field?
        • Introducing parent-child ticketing in Zoho Desk [Early access]

          Hello Zoho Desk users! We have introduced the parent-child ticketing system to help customer service teams ensure efficient resolution of issues involving multiple, related tickets. You can now combine repetitive and interconnected tickets into parent-child
        • Ability to CC on a mass email

          Ability to CC someone on a mass email.
        • Different Task Layouts for Subtasks

          I was wondering how it would be possible for a subtask to have a different task layout to the parent task.
        • Compensation | Salary Packages - Hourly Wage Needed

          The US Bureau of Labor Statistics says 55.7% of all workers in the US are paid by the hour. I don't know how that compares to the rest of the world, but I would think that this alone would justify the need for having an hourly-based salary package option.
        • Customizing Helpcenter texts

          I’m customizing the Zoho Desk Help Center and I’d like to change the wording of the standard widgets – for example, the text in the “Submit Ticket” banner that appears in the footer, or other built-in widget labels and messages. So far, I haven’t found
        • Ability to Edit Ticket Subject when Splitting a Ticket

          Often someone will make an additional or new request within an existing ticket that requires we split the ticket. The annoying part is that the new ticket maintains the subject of the original ticket after the split so when the new ticket email notification
        • Automatically Update Form Attachment Service with Newly added Fields

          Hi, When I have a Form Setup and connected to a 3rd Party Service such as OneDrive for Form Attachments, when I later add a new Upload Field I have to remove and redo the entire 3rd Party Setup from scratch. This needs to be improved, such as when new
        • 🚀 WorkDrive 6.0 (Phase 1): Empowering Teams with Content Intelligence, Automation, Accessibility, and Control

          Hello, everyone! WorkDrive continues to evolve from a robust file management solution into an intelligent, secure, and connected content collaboration platform for modern businesses. Our goal remains unchanged: to simplify teamwork, strengthen data security,
        • Reopen ticket on specific date/time

          Is there a way that we can close a ticket and setup a reopen of that ticket on a specific date and time? (without using the "on hold" ticket option)
        • [Important announcement] Zoho Writer will mandate DKIM configuration for automation users

          Hi all, Effective Dec. 31, 2024, configuring DKIM for From addresses will be mandatory to send emails via Zoho Writer. DKIM configuration allows recipient email servers to identify your emails as valid and not spam. Emails sent from domains without DKIM
        • Column letter from number

          Hello, I am trying to select a cell and i have the column number. How do i do this or is there a way of getting the letter from the number? Thank you
        • API credit COQL COUNT

          The docs describe API credits in COQL from the LIMIT perspective: https://www.zoho.com/crm/developer/docs/api/v8/COQL-Overview.html When using aggregate functions such as `COUNT` or `SUM`, is that billed as 1 API credit?
        • Weekly Tips : Save Time with Saved Search

          Let's assume your work requires you to regularly check emails from important clients that have attachments and were sent within a specific time period. Instead of entering the same conditions every time—like sender, date range, and attachments included—you
        • Remove 'This is an automated mail from Zoho Sign' in footer

          Hi there, Is it possible to remove or change the text under the e-mail templates? I can't figure out how to do that: Would love to hear from you. Kind regards, Tristan
        • Organize and manage PDFs with Zoho PDF Editor's dashboard

          Hello users, Zoho PDF Editor's dashboard is a one-stop place to upload, sort, share PDF files, and more. This article will explore the various capabilities that Zoho PDF Editor's dashboard offers. A few highlights of Zoho PDF Editor's dashboard: Upload
        • Custom function return type

          Hi, How do I create a custom deluge function in Zoho CRM that returns a string? e.g. Setup->Workflow->Custom Functions->Configure->Write own During create or edit of the function I don't see a way to change the default 'void' to anything else. Adding
        • Passing Info from Function to Client Script

          Hello, I have recently started making use of client script for buttons, allowing me to give the user information or warnings before they proceed. This is great. However, I have never quite managed to pass back any extra information from the function to
        • Drag 'n' Drop Fields to a Sub-Form and "Move Field To" Option

          Hi, I would like to be able to move fields from the Main Page to a Sub-Form or from a Sub-Form to either the Main Page or another Sub-Form. Today if you change the design you have to delete and recreate every field, not just move them. Would be nice to
        • Zoho Payroll for Canada

          Is anyone else having problems getting setup for Canada?
        • Passing the CRM

          Hi, I am hoping someone can help. I have a zoho form that has a CRM lookup field. I was hoping to send this to my publicly to clients via a text message and the form then attaches the signed form back to the custom module. This work absolutely fine when
        • One Contact with Multiple Accounts with Portal enabled

          I have a contact that manages different accounts, so he needs to see the invoices of all the companies he manage in Portal but I found it not possible.. any idea? I tried to set different customers with the same email contact with the portal enabled and
        • User Automation: User based workflow rules & webhooks

          User management is an undeniable part of project management and requires adequate monitoring. As teams grow and projects multiply, manual coordination for updating users & permissions becomes difficult and can give way to errors. User automation in Zoho
        • Disable Zoho Contacts

          We don't want to use this app... How can we disable it?
        • Default Ticket View - Table?

          Guys, We mostly use the table view to queue tickets. Maybe I am missing it - but how can I set that view as 'default" for all our agents? Thanks JV
        • Zoho One IS BUGGY

          Here are some things that just don't work: - Disabling applications from certain Spaces - Adding users (probably only for me) - Renaming applications in Zoho One Portal (fixed by now) - Reordering applications in Spaces When I try to reorder: It feels
        • Next Page