I’ve looked around and couldn’t find anything regarding my idea; so if you know of a topic already about this feel free to link it and I can go look at it. Here’s my idea:
The person I’m making the app for wants to have a reward/award/achievement system for completing tasks. They would like to have a page where you can view the achievements, their description, an icon, and for them to trigger on specific triggers.
The majority of the app is running on dynamic Local DB using DataViewer lists to display the assets. It is a therapy card app - You tap on a data viewer list item and it using a Row ID variable to pull the image from the Local DB into a full screen view. Here is my perceived problem with the achievement system and making it function.
I feel that I could block out the code for achievements for generic actions (like “Make your first note” or “Open your first card”) but my boss wants the achievements to be for specific triggers like “50% completion” and “100% completion” and “Checked in for 5 days in a row” kind of stuff. I don’t even know if those kinds of things are possible in the software in Thunkable.
I told them that I would research to see if Thunkable had that capability and would get back to them. Any ideas? I’m just looking for ideas to see if it would work and if anyone knows for certain that this is possible/impossible with the resources at our disposal.
Let me know if you have questions; I’ll get back to you as soon as possible.
Thank you in advance.
So I designed the solution after many days of trying to solve the problems I was having in making everything work seamlessly. This is going to be a lengthy edit… so buckle up!
FIRST: I decided to scrap the
Data Viewer Grid since I couldn’t figure out how to reference a specific
Row Id that functioned. I decided to go with this layout instead:
Instead of using a
Data Viewer Grid and a LDB, I used image place holders and rows in a scrollable column. After some testing and editing, I got it looking and working the way I wanted it to. Then I set each image to have a default grayscale version of each reward I wanted to give:
When the event triggers to give the award, it changes the image to the colored version of the image using
When Screen Opens logic. I’ll post all of the logic I used too. Then it was just figuring out how to get the events to trigger correctly. That was the hard part.
What I did was set a database with my references from another screen to have an “opened?” column. When each row was clicked, that
Row Id would set it’s opened? value to “1”. Then I put a
Sum of List using those values. Instead of fighting it to make it 1+1=2, I decided to just stick with 1+1=“11” and not fuss with it. See Images below for reward trigger logic blocks:
Above is the beginning of the awards triggering a % complete award.
Above is the end of the logic with a completionist reward
Functionfor getting all rewards. I added a
Notblock so that it wouldn’t add a new row to the list (see below) that I was using to keep track of what rewards were earned. Once that
textvalue was added (eg. the “9”) it would check before adding another if it found a value that matched it already. If so, it wont add a new line in the list with the matching
textvalue. The Text value that it sets is a list that is set as a variable as seen below:
To control the list values, I set it to be ordered from Least to Greatest, thus creating a new variable. This was so that the rewards don’t trigger multiple times leading to getting repeat values triggering the event before the actual reward was earned. It’s just what my particular rewards needed (I have 1 card, 5 cards, 10 cards… set to when page opens. I didn’t want them to get a reward value each time the page opened…).
The sorted list then checks for the ‘code’ of 123456789 and if that specific value is seen in the sum of the sorted list, then you get the platinum trigger.
Lastly, I wanted people to know what they are trying to get to I set an
Alert to trigger when they tap the image and depending on what image they tap, it sets the alert text accordingly:
I disabled the Cancel button and set the Confirm button’s text to say “back” so that they weren’t confused:
I hope this works for anyone else that needs idea’s on how to set awards or achievements in your own app.