So far with the Marvel Snap app, we’ve been retrieving character cards. Before we start looking at how to shuffle a game, we’ll need to retrieve Location Cards so we can use them in our game.
We’ve already created a Retrieve Marvel cards Integration hub action which hits the API that we’ve been working with. We started looking at the additional card types at some point, but we never set them up properly. We’ve got the “loop behaviour” for the Character records, and that’s looking suspiciously like a reusable subflow:

Now ideally I’d want to turn items 3-6 into a reusable subflow. There’s supposed to be a new feature in Vancouver that lets me do that – select multiple items and create a subflow. What does docs say about that? hmm… ok I need to use the “Select Multple” option from the Action section – not super obvious, but cool let’s try that:

Let’s try to convert the whole loop (steps 1-5) and see what happens – we get to name the new flow, but not define inputs yet:

Ok we can work with this. Let’s define the input for this new subflow. We need the…. card type only really. Let’s try that. All I really need to do here is rename the API call and make sure it’s grabbing the type from the input:

Ok, so we have a little problem – the API returns the type with a capital letter, but our choice values (on the target table) are lowercase. Annoyingly we’re going to need to transform this stuff. Let’s build a Decision Table via decision table – we can use our native choice values, then translate them to the “Summon/Location/Character” strings that the API expects:

This means we can use the “choice” value in the “create card” action successfully:

Alright, this is working ok. Right now this is going to create records every time it’s run. In future we probably wnat to direct this through something like a transform map to make sure that updated data is based on correlated reocrds – currently it will re-create records that we already have, but for now this will help me get my Location and Summon cards into the card database.
Back on our original Subflow (even though we’re not going to run it right now) we can update to call the same subflow with different inputs three times and grab all our data – the parent flow is simplified, and the subflow is just called 3 times:


Leave a Reply