Forum Academy Marketplace Showcase Pricing Features

Number attached to single users data field

Hi all, trying to make a system where I could “gamify” a user filling out their own details. I made a data type called completion which is where the number should be stored. However getting a +1 incremental value that is also dynamic seems to be a problem since I cannot transfer a current users data into a numeric list. For example :

Height is filled out + 1
weight is filled out + 1
location is not filled out 0
2 / 3 * 100 = my percentage
Then I can use that data to make a progress bar by turning it into a percentage. But as I previously said I can’t seem to turn the data into numbers in an efficient way nor make it dynamic where if the data was deleted then it would go back to 0
Anyone know the best solution to this or if I need to go about this in a different way?

Hello -

You’re definitely on the right track. There are a ton of different ways to set up a functionality like this, and which one you choose largely depends on the flow of the UI and how many fields you are attempting to track.

In general, I would definitely track the initial data entry on sign up using a custom state and “input is changed” workflows. On each input, create two workflows: one that says “when this input's value is changed -> only when this inputs value is not empty -> increment custom state by 1,” and another that says the opposite, “when this input's value is changed -> only when this input's value is empty -> decrease custom state by 1

Then, on the workflow that signs the user up (or makes changes if this is more of an “onboarding” screen), you can set the initial value of the “completion” field to be the custom state value.

From there, you’ll just want to account for any changes the user can possibly make. Anywhere you have an “edit” screen where they can fill out more information, you should create the same type of workflow that tracks the changes in a custom state, and then updates the user record once they are done editing.

You can also eliminate the custom state all together and directly update the user record via the “input is changed” workflows.

I hope this helps!

Hi there, thanks for the advice however running into a problem currently where I’m using a dropdown for some of these values and every time the user changes the value it seems to run the workflow. So every time the dropdown is changed, the value increases.