Hi everyone. I’m hoping for some help.
I’m building an app with 50 guide cards. I want to have a front page where you see a card with a button that pulls one random card from my table and displays it on a ‘Detail Screen’.
My problem is that when I select ‘Show Detail Screen’ on my button, I can’t find ‘Random Item’ under data sources. I only see ‘User Profile’ and ‘This Item’ in the menu, even though my tab’s source is set to my card table. How do I force Glide to show ‘Other Sources’ or my table so I can select a random card?
Not sure if the images are useful for info…
Best regards Adele
If you want it to be a “front page”, are you building on a tab level, or do you plan to show those cards only after the users click a button?
If you can show us screenshots of your setup, that’d be great.
Thanks for your answer.
It’s an app with 50 angel cards, but my app is called “Guide Cards”.
I want the user to get to the front page, as you see in the picture, a card of the glass ball, and then press the button that says “Draw today’s card”.
And when the user has pressed the card, a random card should appear, similar to the one you see in the picture, with card and text.
My problem is that I can’t get the button to release the card.
Sorry, the app is in Danish.
- Add a Single Value > random column to your Users table and get a random row from the Cards table.
- Add a lookup column to get the rowID of the random row above.
- Add a “Last clicked” column to your Users table to store the last time the button was clicked.
- Add a “Last ID” column to store the last card ID that the user viewed.
- Add a relation column to relate the last ID to the cards’ rowID.
When they click the button:
- If “Last clicked” is not within today, then show the detail screen of the Single Value > Random row, and set “Last clicked” to current timestamp, set “Last ID” to the lookup rowID value.
- If “Last clicked” is within today, show the detail screen of the last ID relation, so you don’t show two cards within the same day to the user.
This setup automatically resets come tomorrow.
1 Like
Okay, thank you very much for your explanation and for your time. I’ll try to figure it out.
1 Like
Let us know if we can help you further! Some screenshots of your data and components set up when asking questions always help.
Thanks for your help.
When I press the big button on the front page, a card appears as it should. But when I then press the small icon at the bottom of the app, where it says “Today’s Guide Card”, it should show the same card that has been drawn for the day, and not the entire list.
So the problem is, it should only show ONE card and not the entire list. How do I fix it?
The pictures show the front page with “Draw the Day Card” and the card that is drawn, for example “New Mod”.
And “Today’s Guide Card” where it shows the entire list and not just one card.
And the pictures show my Data both “Users” and “50 Guide Cards and Glide Setup”
So “Forside” is where you draw the card, and “Dagens Guidekort” is where you want to show the card of the day?
Yes, correct, so the user can go back to “Today’s Guide Card”. If they have forgotten what it said, they can go back and read the card again later in the day.
On this part, you know already what card the user has generated for today.
So the idea is when that ID is not empty, AND “Last clicked” is within today, then you show that tab.
Then either filter the tab to that ID, or use a custom collection and filter the collection to that ID, and build your components to show the card info.
Okay, it looks like it’s configured correctly now. Thanks for the help.
1 Like