Upload Image from ZOHO Creator to ZOHO CRM

Upload Image from ZOHO Creator to ZOHO CRM

#Tips & Trick of the Day
  1. data = Ar[ID == 4227213000000688005];
  2. myImage =  data.Site_Picture.replaceAll("/sharedBy/appLinkName/", zoho.appuri);
  3. myImage = myImage.replaceAll("viewLinkName", "All_Ares");
  4. myImage = myImage.replaceAll("fieldName", "Site_Picture");
  5. ImageUl = myImage.getsuffix("\"").getprefix("\"");
  6. ImageUl = ImageUl.getsuffix("image/");
  7.         //ImageUl  = "Image Name which we have inside the zoho creaot report with the id";
  8. ID = 4227213000000688005;
  9. XXpublicKEYXX = "OpG1Y2xFTfhjJMmR0DWuZmjhQEMa666E3M4MBtQNAepCEsfWbN4454hfgvH1UhnOmAuNy6X3uV5TDvE4jAmHRbXwS5fjy3MHaUBH";
  10. ImageUl =  "https://creatorapp.zohopublic.com/file" + zoho.appuri + "All_Ares/" +ID+ "/Site_Picture/image-download/"+XXpublicKEYXX+"?filepath=/" + ImageUl;
  11. GetImage = invokeUrl
  12.     [
  13.     url: ImageUl
  14.     type: GET
  15. connection: "creator_app_auth_connection"
  16.     ];
  17. GetImage.setParamName("file");
  18. response = invokeurl
  19. [
  20. url: "https://www.zohoapis.com/crm/v3/Leads/4655606000005549022/Attachments"
  21. type: POST
  22. files: GetImage
  23. connection:"zohocrm1"
  24. ];
  25. info response;