Part 6: Adding cards to my deck

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!

Screenshot 2023 11 08 at 22 46 42

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

Screenshot 2023 11 08 at 22 47 19

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:

Screenshot 2023 11 09 at 22 09 16

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:

Screenshot 2023 11 09 at 22 27 06

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…


Comments

Leave a Reply

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