product_data = zoho.crm.getRecordById("Products", 3241967000031257016);
//info product_data;
CureMD_Providers = product_data.get("CureMD_Providers");
finallist = List();

for each product in CureMD_Providers
{
    // Create a new map for each product to avoid reusing the same map
    Updatemap = Map();
    
    // Extract values from the product record
    count = product.get("Count");
    Provider_Name = product.get("Provider_Name");
    FullTime_PartTime = product.get("Pick_List_1");
    EPCS = product.get("EPCS");
    Telemedicine = product.get("Telemedicine");
    Claim_Scrubber = product.get("Claim_Scrubber");
    novelHealth = product.get("novelHealth");
    Total_Number_of_Providers = product.get("Total_Number_of_Providers");
    
    // Add the values to the map
    Updatemap.put("Count", count);
    Updatemap.put("Provider_Name", Provider_Name);
    Updatemap.put("Full_time_Part_time", FullTime_PartTime); 
    Updatemap.put("EPCS", EPCS);
    Updatemap.put("Telemedicine", Telemedicine);
    Updatemap.put("Claim_Scrubber", Claim_Scrubber);
    Updatemap.put("novelHealth", novelHealth);
    Updatemap.put("Total_Number_of_Providers", Total_Number_of_Providers);
    
    // Add the map to the final list
    finallist.add(Updatemap);
}

// Create the final map for updating the record
final_map = Map();
final_map.put("CureMD_Providers_Detail", finallist);

// Update the record with all the subform entries
update_data = zoho.crm.updateRecord("Account_Products", 3241967000037929350, final_map);
info update_data;


return "";