Hello,
I’m current trying to build a card collection builder and I’ve ran into a problem which I cant seem to solve:
For some context, I have 3 data tables (Cards, Collections and Collections_content). My homepage shows all the names from the Collections data table. When you click one serie you will see a list from collections_content where the name equals the name you clicked and a search functionality which searches through the Cards data table.
The search results contain a button per result which gives you the ability to add that card to your collection. Im trying to figure out how I can add a link to the card in my Collections_ content so I can easily reference details(price, serie, etc). This means that the Collections_content data table will contain two columns (collection as a reference to Collection and cardLink as a reference to Cards).
I’ve tried the following but it’s not working:
In the server module:
@anvil.server.callable
def link_card(card):
link = app_tables.cards.get(Name=card)
return app_tables.collections_content.add_row(CardLink=link)
on the button:
def button_1_click(self, **event_args):
card_to_link = anvil.server.call('link_card', self.card_name.text)
app_tables.collections_content.add_row(CardLink=card_to_link)
What am I doing wrong?
Here’s a link for anyone who wants to look:
https://anvil.works/build#clone:CUNLWTMN5XJYIHXS=LF6ZMGD6RXI4725UDVPJ7RFG
Thanks in advance for any help!