How is your experience with the OutSystems Community?
23
Views
3
Comments
How to open camera when click on a button?
Question
Application Type
Mobile

How to open a camera when we click a button, for example? tq

2026-05-21 04-48-12
Deepa Tiwari

Hi @IQ78 ,

1.You can use fileupload widget and use css for display none like below.

2.After that you can use button or icon below have camera icon use onClick for it.

3.CameraOnClick action use this js below-

4. Where widget id is FileUpload widget Id.

This allow you to open camera in Mobile and on browser it will open folder.

Hope this will help you.

2026-03-03 06-24-34
Grijesh Suman

Hi @IQ78

To open the device camera on a button click in an OutSystems Mobile Application, you can use the Camera Plugin from Forge. 

First, install the Camera Plugin and add its dependency to the application. Create a screen variable of type Binary Data to store the captured image. Add a button (for example, "Open Camera") and implement its On Click client action. In the action, first call CheckCameraPlugin to verify that the plugin is available on the device. If the plugin is available, call the TakePhoto action. Configure the required parameters such as photo quality, camera direction (front or back camera), and orientation settings. After the user captures a photo, check whether TakePhoto.Success = True. If successful, assign TakePhoto.MediaResult.Thumbnail (or the returned image) to the Binary Data variable created earlier. The captured image can then be displayed using an Image widget by setting its Type to Binary Data and binding the image content to the variable. This approach opens the native device camera when the button is clicked and returns the captured image to the application.

2026-09-15 12-16-56
Mohammed Sadiq

Thank You for Sharing!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.