Problem with default value by using Bulk Write API

Problem with default value by using Bulk Write API

Hi guys,

I have a problem with the bulk writing API.

I have 2 modules. First module ("dataimport") is storing csv file uploads of users. The secound module ("Erzeugungsdaten") should store the data from those csv files.
My goal is that each entry in "Erzeugungsdaten" is linked to the file upload in "dataimport" module so I setup a lookup field.

So I created a workflow which runs after a csv file is uploade to the module "dataimport". This workflow triggers a function using the bulk write api and it works good when I not try to set a default value for the lookup field. 

When I add the part where I like to link the imported rows to the lookup field I get the error that I need to define the "index" parameter which does't make sense in my case because it should be set as default value.

  • {"status":"error","code":"MISSING_REQUIRED_KEY","message":"required key index for field LinkedDataimport is not found in request body.","details":{}}
Here my code where I define the default value:
  1. dataImportMap = Map();
  2. dataImportMap.put("api_name","LinkedDataimport");
  3. //dataImportMap.put("index",0);
  4. dataImportMap.put("find_by","id");
  5. dataImportMap.put("defaultValue",{"value":dataImportID});
  6. fieldMappingList.add(dataImportMap);

Hope someone of you has an idea how to fix it.

Best
Markus

PS: find attached the whole function

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now