Expression not evaluated

The expressions marked with #This doesn't work below aren’t being evaluated. It seems to be returned verbatim, as in the screenshot below. I have tried enclosing them in single quotes, double quotes, and plain. How can I fix this?

          - component: oh-repeater
              sourceType: array
              in: =JSON.parse(items[].state) # This works fine
              for: photo
              fragment: true
                - component: oh-image
                    lazy: true
                    url: # This works fine
                    action: photos
                      - url: # This doesn't work
                        caption: # This doesn't work
                      type: popup
                      toolbar: false
                      swipeToClose: true
                      exposition: false
                      width: 190px
                      height: 106px
                      object-fit: contain
                      padding: 1px

Individual array elements cannot contain expressions. For that particular parameter a JSON serialization is also acceptable so here’s how I made it in one of my widgets:

              actionPhotos: '="[{\"item\": \"" + props.albumArtItem + "\"}]"'

In your case (untested) something like:

              actionPhotos: '="[{\"url\": \"" + + "\", \"caption\": \"" + + "\"}]"'

Ugly, but no other choice AFAIK.

Thanks for the suggestion. Out of curiosity, why can’t individual array elements contain expressions?

I got mine to work using:

actionPhotos: =JSON.parse('[{"url":"' + + '", "caption":"' + + '"}]') 

it avoids escaping the dbl quotes

so then I found out that this also works:

actionPhotos: ='[{"url":"' + + '", "caption":"' + + '"}]'

and your version also works with the single quotes enclosing the whole =xxxx expression.

I am very confused about the single and double quotes. Could you please shed some light about the difference between these three:

something: =items.Itemname.state
something: '=items.Itemname.state'
something: "=items.Itemname.state"

This page seems to offer some clear introduction:

Your version does look nicer indeed, less escaping!

I take it that this is the response to my question “why can’t individual array elements contain expressions?”

As I understand it, and I might be wrong here, is that this yaml:

  - level2a1: value
    level2a2: value
  - level2b: value

will translate to a json object where the array elements are dictionaries / hashes, not scalars:

{ level1: [ {level2a1: value, level2a2: value}, {level2b: value} ] }

hence my confusion why expressions can’t be evaluated there. Could you point me in the general location in the source code where the expression evaluation / extrapolation is being done?

Ah, no it was actually in response to:

I’m not sure exactly (or I don’t remember) if there’s a good not to allow expressions in array members, all I can say is, it isn’t implemented.