Subform Zoho Form to Creator
Hi,
I would like to be able to retrieve the values of a Zoho Form subform to create an entry for each in Zoho Creator. To send from Form to Creator, I use Zoho Flow.
I have a custom function, which should normally retrieve each field value then create an entry in Creator for each entry in the subform, but it doesn't work.
Zoho Form output data :
- {
- MODIFIED_USER : "mymail",
- ADDED_TIME : "03-Feb-2025 08:16:33",
- SubForm : [
- {
- FileUpload4 : [
- {
- path : "myurl/1738588577854_Logo_noir_2024.png",
- extension : "png",
- name : "Logo_noir_2024.png"
- }
- ],
- SingleLine1 : "Test entrée 1 num cab",
- MultiLine2 : "Test entrée 1 dec",
- Dropdown3 : "Oui",
- Dropdown2 : "A COMMANDER",
- MultiLine3 : "",
- Dropdown1 : "",
- SingleLine : ""
- },
- {
- FileUpload4 : [
- {
- path : "myurl/1738588591305_Logo_noir_2024.png",
- extension : "png",
- name : "Logo_noir_2024.png"
- },
- {
- path : "myurl/1738588591355_logo_zoho-books.xcf",
- extension : "xcf",
- name : "logo_zoho-books.xcf"
- }
- ],
- SingleLine1 : "Test entrée 2 num cab",
- MultiLine2 : "Test entrée 2 dec",
- Dropdown3 : "Non",
- Dropdown2 : "A FAIRE",
- MultiLine3 : "",
- Dropdown1 : "",
- SingleLine : ""
- }
- ],
- form_id : "TestMaxRapportinstallation",
- ADDED_TIME_ISO8601 : "2025-02-03T08:16:33.000-05:00",
- IP_ADDRESS : "142.169.198.208",
- DecisionBox : "true",
- REFERRER_NAME : "myurl/form/TestMaxRapportinstallation/thankyou"
- }
Custom function Flow input :
- {
- inputForm : [
- {
- FileUpload4 : [
- {
- path : "myurl/1738588577854_Logo_noir_2024.png",
- extension : "png",
- name : "Logo_noir_2024.png"
- }
- ],
- SingleLine1 : "Test entrée 1 num cab",
- MultiLine2 : "Test entrée 1 dec",
- Dropdown3 : "Oui",
- Dropdown2 : "A COMMANDER",
- MultiLine3 : "",
- Dropdown1 : "",
- SingleLine : ""
- },
- {
- FileUpload4 : [
- {
- path : "myurl/1738588591305_Logo_noir_2024.png",
- extension : "png",
- name : "Logo_noir_2024.png"
- },
- {
- path : "myurl/1738588591355_logo_zoho-books.xcf",
- extension : "xcf",
- name : "logo_zoho-books.xcf"
- }
- ],
- SingleLine1 : "Test entrée 2 num cab",
- MultiLine2 : "Test entrée 2 dec",
- Dropdown3 : "Non",
- Dropdown2 : "A FAIRE",
- MultiLine3 : "",
- Dropdown1 : "",
- SingleLine : ""
- }
- ]
- }
- Custom function Zoho Flow output :
- {
- subFormToCreator_1 : [
- ]
- }
Creator record input :
- {
- Form : "Test_Forms",
- Multi Line : "",
- Single Line : "",
- Application : "maxtest"
- }
Creator record output :
- {
- projet : "",
- numcab : "",
- description : "",
- ID : "4535260000000936003",
- status : [
- ],
- resolved : ""
- }
My custom function in Flow :
- list SubFormToCreator(string inputForm)
- {
- formData = inputForm;
- subFormEntries = List();
- if(formData.containsKey("SubForm"))
- {
- for each entry in formData.get("SubForm")
- {
- info entry;
- entryData = Map();
- // Extraire les données nécessaires
- entryData.put("FileUpload4",entry.get("FileUpload4"));
- entryData.put("SingleLine1",entry.get("SingleLine1"));
- entryData.put("MultiLine2",entry.get("MultiLine2"));
- entryData.put("Dropdown3",entry.get("Dropdown3"));
- entryData.put("Dropdown2",entry.get("Dropdown2"));
- entryData.put("MultiLine3",entry.get("MultiLine3"));
- entryData.put("Dropdown1",entry.get("Dropdown1"));
- entryData.put("SingleLine",entry.get("SingleLine"));
- // Ajouter l'entrée à la liste
- subFormEntries.add(entryData);
- }
- }
- return subFormEntries;
- }
Do you have a function that is already working, or help me find where the problem is coming from?
Thanks for your help!