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 *