Hello, I would like to extract 10 cards chosen randomly from an CARDS database and for each of them create an entry in the NFT-MetaData database, then assign the Current User the corresponding uniqueID by modifying the NFT_owned field (List of CARDS) in the database. USERS data.
I followed the following method:
Step 1: Create a Workflow API to Create NFT-Metadata
Create a Workflow API:
In the "Backend Workflows" tab of Bubble.io, create a new Workflow API called "create_nft_metadata".
Configure this Workflow API to accept the necessary parameters:
card_id (of type Card)
user_id (of type User)
Create an Entry in the NFT-MetaData Table:
Add a “Create a new thing” action in the Workflow API to create an entry in the NFT-MetaData table.
Configure the fields as follows:
CardID: card_id (Workflow API parameter)
Owner_ID: user_id (Workflow API parameter)
Update User:
Add a "Make changes to a thing" action to update the user's NFT_owned field.
Configure the action to add the new NFT-MetaData entry to the user's NFT_owned list.
Step 2: Call the Workflow API for Each Selected Image
Program a Workflow on a List:
Return to the registration workflow.
Add a “Schedule API Workflow on a list” action.
Configure it as follows:
Type of things: Cards
List to run on: The 10 random images selected
API Workflow: create_nft_metadata
card_id: This Card's unique ID
user_id: Current User's unique ID
The 10 NFTs are correctly created, but for the Update user step the NFT_owned list only contains 5, or even 6 elements. Does anyone have a solution?
Thanks in advance