This is just a quick update – I’ve been doing some cleanup work just getting the data creation activities for Matchmaking and Game Instantiation working. I realised that I only had a couple of Decks to play with, so I wanted to get a quick and dirty deck list page into UI Builder.
This is really ugly for now, but it’s mostly so I can get testing and navigation sorted out.
I created a new page from scratch, set a Page Parameter for the userID of the player, and defaulted it to my friend Abel Tuter.
I then added a list component, and created Modal so I can create new Decks when I click the New button on the list.

The modal has an input field for the Deck Name – that’s basically all I need for a deck – A name and a Player. I create a Client State parameter for the Deck Name which is set whenever the input component is updated so that when I call an event from my “Create” button it can pass the deck name to a “Create Record” data resource.
The Create Record data resource is interesting – all the attributes to create the record are passed in the event handler, so I passed it the User ID from my context properties, and also the Client State Parameter with the deck name. I set the table to be my Player Deck table…. this successfully creates the record:

My next challenge is trying to redirect to the Deck Builder interface that I built a while back… I need to get the sys_id of the newly created record from the Data Resource. This proved to be a little tricky – I could add an event handler to the “Operation Succeeded” event from the Data Resource, but the lookahead didn’t bring back any of the content of the payload that I could use. I got some advice on the SN Devs Slack channel (awesome resource) from the ever helpful Brad Tilton who suggested writing the payload to the console log. This meant writing a tiny client script, but because this is for debugging purposes I’m not counting it towards my “no code” challenge.
Once I’d written the payload to the console I was able to spot my SysID nested very deep in JSON schema:

This gave me the path of @payload.data.output.data.GlideRecord_Mutation.insert_x_168987_flow_de_0_player_deck.sys_id.value which is a mouthful, but it returns a sys_id that I can use.
I could then add an event handler to “link to destination” using this path once the newly created deck has been added.
Leave a Reply