Now that we’ve got a UI Page which lets us display cards to add to my deck, we need to find a way to trigger the subflow. I’ve decided that I want to have some sort of “event queue” type record that will be the trigger for adding or removing cards from the deck (e.g. clicking a card that’s not yet added will pop a record into the queue to say “please run the subflow for adding records” and clicking a card in your deck (which doesn’t yet exist) will create a “remove” queue record. I’ve called that table the “Deck Modification Event” and added a choice for the two behaviours, as well as references for the cards and decks being affected. I’ve also got a status choice so I can track events that haven’t been processed or which have failed.
Next I need to get my click eventt to trigger record creation in UI Builder… my assumption going in is that I’ll be able to do this with some sort of simple data broker… we’re at risk of needing to actually write some code here, so let’s see how well we can avoid writing code for this operation in UIB….
A “Create Record” Data Resource looks promising, let’s add one!

Uh oh – I can’t do any data binding…. I might need to do some code!

NEVER MIND! When I add an Event handler to a button on the Card Component, it lets me map the table and the data bindings required for the condition:

Now my “Add To Deck” button which calls an event handler that triggers the Create Record data resource is creating records! I can tell this is the case, because I’ve added an event to the Create Deck Modification Data resource Events for “Operation Succeeded” to call an Alert Message:

This is great! No code yet! Next I need to define a flow trigger on my Deck Modification Event table so that I can get the actual Player Deck Card subflow to trigger.
Good progress on deck building so far! Let’s see how I go with my deck card removal behaviour…

Leave a Reply