I’m still working on getting a playspace runnning.  New updates include creating repeaters for each of the location areas for each player – 4 slots per player per location.

To do this, I’ve augmented the Game instatiation flows so that each location automatically creates 4 slot records per player – in the last update I said I wouldn’t rely on repeaters, but given I know that we will have a hard-limit on the slots, it’s ok if my renderer is based on repeaters that have Data resources for each player and location combination ordered by slot number.

Each of these slots will also show the card image – however I need a way to hide the card image if there’s no card (so the component isn’t empty).

My first instinct was to script the “Hide component” configuration based on the value in the card_instance field for the slot.  This worked with a bit of messing around, but at this point I’ve violated my “no code” guideline again:

 

In order to turn this into a no-code situation, I’ll need to have a boolean somewhere that tells the UI whether to render the slot or not…. I can put that on the slot record:

This is a bit of a pain, because I have 6 Data Resources that haven’t yet got that new field available, then I have 6 repeaters that I need to update with the item mapping.  When you’re creating a playspace with lots of instances of the same type of data the Data Resource mapping can get a little complex to update using the UI Builder interface.  Hopefully some of this gets a little easier in ServiceNow in future – it can take a while to render the parts I need to update or parts of the UI can be annoying to get to (excessive scrolling or clicks to get to the parts I need).  That said, it’s proving to be quite “no-code” friendly to acheive outcomes, and quite flexible.  I’m suspecting that I’ll have a lot of performance issues due to my reliance on data resources and watchers, but at least we’re getting things done relatively well.

When I set my Visibility data mapping to the repeater Item, I needed to reverse the logic – E.g. my slot says “Slot Visible = false” which means that the “hide component” data mapping needs to be “! Slot Visible = true”:

This gets me to the point where I can hide the “unused” slots without having to resort to any code!  I’m still at the point where the only code I’ve written is a Card Shuffling action in Flow Designer.  UI Builder is still no code at this point.


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *