Mobile camera: is there a way to display the captured image?

Hey all,

As a user, when i have captured images with the mobile camera component and saved them to a database or API, I'd like an easy way to view them.

  • The retool mobile camera component captures an image and presents it as a base64 string.
  • The retool mobile image component loads an image from a URL (but as far as I can see, not from a base64 string - either locally or returned by a database or REST API)

Short of running a webserver to publish each image on a known URL, and pointing the image component at it, has anyone found a way to load the base64 string from the camera straight into an image component so the user can see it?

Thanks!

Hey @bcl22, welcome to the community :hugs:

You can actually pass the base64 string in the URL input of the camera component :))

Try it out.

1 Like

Thanks @minijohn, that works nicely!

It took me a moment to realise the camera returns an array of base64 strings, and the image of course wants just one string, so passing {{ camera1.value[0] }} displays the first image nicely.

2 Likes