Zoho Forms / Zoho Flow Estimate Creation - Work Types?

Zoho Forms / Zoho Flow Estimate Creation - Work Types?

We are attempting to use a Zoho Form as a trigger in a Zoho Flow to create an estimate in FSM. The estimate creation works when adding services to the estimate but the issue we are having is getting the Work Types to be recognized and the Part Line Items to be added.

For example: A customer makes a pool closing request in forms, the service is "Pool Closing" , the Work Type for "Pool Closing" is "Pool Closing Work Type". The "Pool Closing Work Type" includes Parts, which are "Antifreeze" (Qty. 3).

When the service "Pool Closing" is added to an estimate manually in FSM (Not through the forms) the Parts are automatically added to the estimate. When done through forms/flow, the parts are not added automatically.

This is our current flow (after access tokens, etc. which we know are working)
get_contact = invokeurl
[
type :GET
parameters:emptyMap
headers:create_header_map
];
contact_size = get_contact.get("data").size();
if(contact_size >= 1)
{
contact_email = get_contact.get("data").get(0).get("Email");
if(contact_email == email)
{
contact_id = get_contact.get("data").get(0).get("id");
Billing_Address_id = get_contact.get("data").get(0).get("Billing_Address").get("id");
Service_Address_id = get_contact.get("data").get(0).get("Service_Address").get("id");
allproducts = {{"id":pool_closing_request},{"id":pool_closing_cover_and_service},{"id":lower_water},{"id":filter_cleaning},{"id":filter_return},{"id":spa_or_swim_spa_closing},{"id":fountains_waterfalls},{"id":chemistry_automation_probes}};
part_list = list();
product_list = list();
for each  product in allproducts
{
product_id = product.get("id").toString();
if(product_id != null)
{
info product_id;
product_id_found = product_id.isNumber();
if(product_id_found == true)
{
final_product_id = product_id.toNumber();
product_map = Map();
product_map.put("Service",final_product_id);
product_list.add(product_map);
get_Work_Type = invokeurl
[
type :GET
parameters:emptyMap
headers:create_header_map
];
Work_Type = get_Work_Type.get("data").get(0).get("Work_Type");
if(Work_Type != null)
{
info Work_Type;
Work_Type_id = Work_Type.get("id");
part_map = Map();
part_map.put("Part",Work_Type_id);
part_list.add(part_map);
}
}
}
}
// part_map2 = Map();
// part_map2.put("Part_Line_Items",part_ist);
// product_list.add(part_map2);
serviceAddress = Map();
serviceAddress.put("id",Service_Address_id);
billingAddress = Map();
billingAddress.put("id",Billing_Address_id);
newRecordInfo = Map();
newRecordInfo.put("Summary","PPCK 2024");
newRecordInfo.put("Status","New");
newRecordInfo.put("Email",contact_email);
newRecordInfo.put("Contact",contact_id);
newRecordInfo.put("Service_Line_Items",product_list);
newRecordInfo.put("Service_Line_Items",part_list);
newRecordInfo.put("Service_Address",serviceAddress);
newRecordInfo.put("Billing_Address",billingAddress);
create_map = Map();
create_map.put("data",{newRecordInfo});
info create_map;
create_estimate = invokeurl
[
type :POST
parameters:create_map.toString()
headers:create_header_map
];
info create_estimate;
}
}
}





                            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 WorkDrive Resources



                                                                  Zoho Campaigns Resources

                                                                    Zoho CRM Resources

                                                                    • CRM Community Learning Series

                                                                      CRM Community Learning Series


                                                                    • Tips

                                                                      Tips

                                                                    • 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