Multiple items in one widget? How to add to content?

(Just in case this is in the wrong category, there is no widget category here so I thought this is the closest match.)

How do I display the second item value?
My approach so far:


uid: TempTestWidget
tags: []
props:
  parameters:
    - description: A text prop
      label: Prop 1
      name: prop1
      required: false
      type: TEXT
    - context: item
      description: An item to control
      label: Item
      name: item
      required: false
      type: TEXT
    - description: A text prop
      label: Prop 2
      name: prop2
      required: false
      type: TEXT
    - context: item
      description: An item to control
      label: Item2
      name: item2
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Jun 21, 2021, 4:49:35 PM
component: f7-card
config:
  title: ="next"
  content: =items[props.item].displayState || items[props.item].state

Adding anything to the content doesn´t display anything, how do I add the second one?

thanks

The items dictionary returns strings for both the state and displayState properties. So your content: is just building and displaying a string. This means that you can add whatever else you like using string concatenation, which in this case is simply a ‘+’. For example:

content: ="First item: " + (items[props.item].displayState || items[props.item].state) + " and Second item: " + (items[props.item2].displayState || items[props.item2].state)
1 Like

Thanks! Yes that is what I expected, I just tried withot brackets and that didn´t work.
Now this one works: content: = (items[props.item].displayState || items[props.item].state) +" — "+ (items[props.item2].displayState || items[props.item2].state)