function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chidambar KulkarniChidambar Kulkarni 

Salesforce1 Camera


How do i attach a photo (as a field) to a custom object?

I am able to open the camera & file browser using the statement below 
<input id="photoFile" type="file" accept="image/*"/>

How do I save and attach it with the Custom Object?

Any help appreciated

Ajay K DubediAjay K Dubedi

Hi Chidambar,
To attach a image to your custom object as a field you can take help of a formula field with function as an IMAGE. For this follow the steps below:
1) Create a new Document from documents tab.
2) Choose the file to upload on the object.
3) Go to the object and create a new Formula field with return type text.
4) In the advancedformula select Image as a function.
5) In the URL put the URL of the image which appears on viewing your document i.e. View your document you created and insert it's URL in the function.
6) Add Alternate text and height and width.
7) Create new record and you can see image in a field.

Chidambar KulkarniChidambar Kulkarni
Hi Ajay,

I am implementing this feature in Salesforce1 android app. I want each user to manually attach photo from camera/gallery from their mobile. I guess, the above approach is to add already existing images in desktop version.

Please correct me if i am wrong.