One Barcode to populate more than one case properties

Hii everyone, Is it possible to use one QR code which contains texts to populate several case properties. E.g. after scanning a QR code that contains age, sex, name etc. will populate the respective case properties.

I hope this is clearer.

Yes, that should be possible. What you'd do is make a single barcode question to read the QR code, then have several hidden values to extract each component from the stored text.

For a simple use-case where the QR stores space-separated elements, you could use the selected-at function to get each element by its position.

For anything more complicated, you'd probably want to use json-property. From the example there, if your QR code contained the following JSON:

  "full": "New Canada St., 3855 Brienz, Switzerland",
  "geopoint": "46.748107 8.0473685",
  "zipcode": "3855",
  "postcode": "3855",
  "city": "Brienz",
  "region": "Bern",
  "state_long": "Bern",
  "state_short": "CH-BE",
  "country": "Switzerland",
  "country_short": "ch",
  "street": "New Canada St."

You could extract the city from your barcode in a hidden value with a calculate expression like

json-property(#form/qr-code, 'city')

and likewise for other properties you wish to save to the case.

Many thanks Ethan!
I will try it out

I am starting to think that I need to read the release notes! this is a pretty cool function

can you think of other use-cases ?

1 Like

I believe it was added for a project-specific workflow, but seemed potentially useful to other projects. This application didn't occur to me until reading this forum post, but it seems remarkably useful.

1 Like

You are welcome! Would be glad to share the experience