UFM for Slider value in List/Collection View?

I’m upgrading a v13 site that displays a Slider value in a ListView.

Now, in v17 I can’t get it to show anything else but [Object object]

{= value } or ${ value } gives me [Object object], but any attempt to get value.length, value[0] or even value.value (who knows?) just renders nothing…

Any pointers to something that works would be nice…

Thanks :raising_hands:
/Chriztian

Hi @greystate

You can log the output to the console to see what values it contains and work out what the expression should be. See:

Another thread that may be useful here:

Do any of these help?

Justin

Thanks @justin-nevitech :+1:

I did have a look at the second one, but my problem is that in the Collection View, you get a value, so I’d assume that I could get the values from that somehow; but I haven’t yet been successful :frowning:

I also really didn’t expect to have to install a third party package, to be able to figure this out, but that might be my only way forward right now. Was hoping someone else had experienced the same thing, upgrading from v13 to v17.

/Chriztian

Back again after trying the debug UFM component…

I hit a few snags along the way — it’s written for debugging blocks, so I had to figure out which “context” to look in for a collection view… anyways, for anyone coming here for the answer:

If your ListView label for a Slider in v13 was rendered something like this: {{ value }}, the CollectionView label in v17 need to use either ${value.to} or ${value.from} (they’re apparently the same for a Slider that’s not set up as a range).

/Chriztian

Slightly late reply here… alternatively, since v17.5 there are valueSummary extensions for most of the property-editor values.

For Collection Views, if you remove the UFM label template, then it fallback on the Slider’s value summary element, which is this code:

Thanks @leekelleher :raising_hands: - great to know!

This was a property being used for rating, so I needed to convert something like this:

${['', '⭐️', '⭐️⭐️', '⭐️⭐️⭐️', '⭐️⭐️⭐️⭐️', '⭐️⭐️⭐️⭐️⭐️'][value]}

— but I never even considered removing the template completely - just tried every single thing (apart from value.to or value.from, obviously :rofl:) - otherwise, I’d probably just have gone with the simpler decimal value… glad there was a simple path once I knew what to write though.

/Chriztian

@greystate Oh yes, I like the star rating snippet a lot! :star_struck: