Cannot get Image Upload to Work
Here is the code I'm using to grab an image and load it to a specific field called Image in a module called Property Pictures:
photo = invokeurl
[
type :GET
];
info photo;
photo.setParamName("file");
// Upload the file variable to the Zoho File System (ZFS)
zfsUpload = invokeurl
[
type :POST
files: photo
connection:"propertypictures"
];
info zfsUpload;
// Using the file id, update the CRM record.
file_id = zfsUpload.get("data").get(0).get("details").get("id");
fmp = Map();
fmp.put("file_id",file_id);
fileList = List();
fileList.add(fmp);
mp = Map();
mp.put("Image",fileList);
info mp;
updateRecord = zoho.crm.updateRecord("Property_Pictures",ID,mp);
info updateRecord;
Here is the output showing no errors:
Info
- 1717674364168.png
- {"data":[{"code":"SUCCESS","details":{"name":"1717674364168.png","id":"a9fd02583c01fbdb40d1116e24e428d7511639c48e4c74f26ce31034aa23447b8f37d2ef977e598d3ac1767ad9095dbf"},"message":"1717674364168.png uploaded Successfully","status":"success"}]}
- {"Image":[{"file_id":"a9fd02583c01fbdb40d1116e24e428d7511639c48e4c74f26ce31034aa23447b8f37d2ef977e598d3ac1767ad9095dbf"}]}
- {"Modified_Time":"2024-06-06T12:46:05+01:00","Modified_By":{"name":"Mark Bowen","id":"303204000000227001"},"Created_Time":"2024-06-05T21:24:31+01:00","id":"303204000028848007","Created_By":{"name":"Mark Bowen","id":"303204000000227001"}}
Function executed successfully
The record in the module has an updated Modified date but no image in the Image field. What am I doing wrong?
thanks!
Mark
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Zoho Orchestly Resources
Zoho Creator Resources
Zoho WorkDrive Resources
Zoho Campaigns Resources
Zoho CRM Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.