I am building a fitness app and would like to show “recent workouts”. I have created a database where each workout has a name and a date (and then data items like distance, weight, etc.).
When I add a text component and click on magic text, name and date are not options for me to display (only data items, like distance, weight, are).
Can someone help me solve this?
Hi @rafaelapp,
Welcome to the forum!
In order to display properties from a Current Workout, you need to have this Current Workout available on the screen.
Do you have it?
Adalo uses “Lists” concept to show list of data items from a collection (in your case - Workouts collection). Then you can access Current Workout inside the list. Also you can add an action to link to another screen, call it “View Workout”. On that screen you will have available data from Current Workout - it is being passed from a list.
Please see here: Lists | Adalo Resources
Best,
Victor.
Thanks for the response but I dont understand. Here is a screenshot (from a different platform I designed on), which should help clarify what I"m looking for. Towards the bottom you see “Recent Workouts” - I need for the date to show here, as it does under '3.2 Miles"
Lists don’t work for me in this case because it doesn’t match my design. The top part “Your Progess” I was able to do with magic text (and filtering averages and sums up to 30 days) because they are all metrics (no dates).
Can you help?
Forgot to add the screenshot. here it is
Dear @rafaelapp,
You can not get data records from Adalo Collections without using lists. This is the fundamental data access feature around which Adalo is built. I highly recommend to read the documentation on how to work with data in Adalo. There are plenty of videos in Adalo App Academy (https://appacademy.adalo.com/) as well.
In your screenshot you have 2 blocks representing recent workouts. So the question is - how do you get data about recent workouts, to put this data into those 2 blocks.
If you take it from Workouts collection, you can not put data to these blocks without using lists (I am not going to talk about hacky workarounds now). List is a way to get records from the collection. So what you need to do is to create a custom list (if you’d like to have a custom design), connect it to Workouts collection, filter by Logged-in User → Workouts, sort by created date → descending, and limit the number of items to 2. Then you will get 2 records of recent workouts for the logged-in user in this list.
The only record which is accessible around the app without adding a list, is a record of logged-in User (Users collection). So there is a possible way to store information about 2 recent workouts in Users, and get the data from these properties. However such approach adds complexity in a screen/place when user completes workout (in addition to creating workout record, the logged-in User record should be updated as well).
Best,
Victor.