I'm trying to do a merge with images, but am getting stuck on the public url needed.
I created this workflow to get an image field (public_url) I can use outside of Zoho (in a Writer merge template). It work's in Zoho Creator also, but not on the merge (still the placeholder image with an error, and takes forever to load this). What did I miss?
Status_Picklist = form with only Rating and Rating_Image (like Product and Product_Image
All_Status = public report for Status_Picklist
Inpsection_Report = form with lookup field for Status_Picklist where output is (not a report--the form is called a report in the industry lol)
Grading_and_Drainage_Status = the Rating lookup field in Inspection_Report
Note--selecting above successfully returns the correct image in an Image field and Public URL image field inside Zoho Creator
Public URL = the image field I'm trying to populate the public URL into and using for merge.
- //get image records records and save as variable name publicurl
- publicurl = Status_Picklist[ID == input.Grading_and_Drainage_Status].Rating_Image;
- //extract record ID
- myID = Status_Picklist [ ID = input.Grading_and_Drainage_Status].ID;
- //create variable for encrypted key
- encryptedKey = "5vAx1bRSnKB5zYnYgs0UvRB46bmZ0NthqjEYsjtD91aCawrPBBfDu8kTu44yW8YCDSG4aXwWCmmssbeX7WRmM8AWrDjbmgy2TbzK";
- //extract image file name from record
- filename = publicurl.getsuffix("image/").getprefix("\" border").trim();
- //modify URL
- if(publicurl != null)
- {
- publicurl = publicurl.replaceALL("creatorexport.zoho.com","creator.zohopublic.com");
- publicurl = publicurl.replaceALL("/sharedBy/appLinkName/",zoho.appuri);
- publicurl = publicurl.replaceALL("viewLinkName","All_Status");
- publicurl = publicurl.replaceALL("fieldName",myID.toString());
- publicurl = publicurl.replaceALL("image/","Rating_Image/image-download/" + encryptedKey +"/" + filename);
- publicurl = publicurl.replaceAll("<img","<img height=51px width=144px");
- }
- input.public_url = publicurl;
This is the url I see inside Creator for the Public URL field when I select a status of Deficient (found in Google Inspect)