I have two tables listing Decks, which contain Cards. The first table shows Decks that a User is subscribed to, while the second table shows all remaining Decks. I want to set up identical Button columns in each table, which would trigger the same query and opening a modal containing a table of the Cards contained within the Deck whose button was clicked.
I feel that this should be possible using the additionalScope
, but I've been struggling for a while now and I can't figure out if I'm the problem, or if this is actually not supported after all. After searching for similar issues here in the Forum, currently my query looks like this:
var value = {"Subscriptions": Subscriptions.data[i]._id, "NonSubscriptions": NonSubscriptions.data[i]._id}[triggeredById]
listCardsInDeck.trigger({
additionalScope: {"selectedDeckId": value}
})
console.log(value)
console.log(listCardsInDeck.data)
I get the correct Deck ID in console.log(value)
. However, console.log(listCardsInDeck.data)
always returns null
.
The listCardsInDeck
query is a MongoDB aggregate query. I mention that because I noted some instructions elsewhere saying that you need to define your variables for e.g. PostgreSQL queries, but the MongoDB interface seems not to have a place to do this. So I'm not sure if this is a Retool limitation. Anyway, this is the part of the query where I'm trying to use the additionalScope
:
{
$match: {
"deckData._id": { "$oid": {{ selectedDeckId }} }
}
}
I'd be very grateful for any insights. I'm rather new to Retool, as well, so I would not be shocked if I were going about this in the wrong way, either.