How do I get data from the data base to progress bar?

Hello,

How do I get data from a created field (number) in the database?

I want the progress bar to use the number from that field.

Thanks, Elias

You can do a search for the number field you want to use in the percentage property of the progress bar and express the result as a percentage of another number. Here’s an example:

3 Likes

Thanks for your answer but I don’t understand how to do it. I think I need it super basic.

First when I click in the persentage property I click on click. What should I pick next?

Click > Do a search for? > ?

Here is the data I need to bring into the percentage property.

Okay, so if you just store a percentage value in MYgoal and want it displayed in the progress bar, you can just put in the percentage property of the progress bar, search for Goal (constraint: Creator = current user) 's MYgoal.

Usually though, progress is relative to something. I’m going to assume that MYgoal is that something. So the user has a goal, which you store in this field. Then the user will have a score or something that they achieve. I don’t see a field for that in your screenshot but let’s call it score. Your percentage would then be something like current user’s score / current user’s MYgoal * 100 (assuming you’re always showing progress for the current user).

I hope this helps.

1 Like

Thanks a lot! This made me understand! :smiley:

I think I am close to getting it working. I have one issue left. The bar don’t change when there is a number in the MYgoal and the score (Current-goal-at).

Link to test version.

I attached the print screens.
Thanks.
Elias

Please share a link to your (public) editor so I can take a look.

EDIT: Looking at the screenshot of your database, you seem to have a table called Goal where you’re storing the goal(s) and score(s). In that case, I think you shouldn’t use current user’s … Instead, it might be something like Search for Goal (constraint: Created By is current user) first item’s current-goal-at / Search for Goal (constraint: Created By is current user) first item’s Mygoal

You need to consider if your database is structured as you need it to be. Can a user have more than one goal over time and more than one current-goal-at at any one point? If so then you’re right to hold the values in the Goal table and you should use the latest values for your percentage. If not then the fields should be stored in the User table and you don’t need a Goal table.

I hope this helps. If not then perhaps you could tell us more about your app and share a link to the editor.

1 Like

Thanks a lot for great help! I figured it out using the user’s mygoal.
The score will be from the user google analytics account that we are working on the API.
Have a great day!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.