Your cart is currently empty!
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!
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