Hi guys,
I’m trying to build an app that enables a company to follow different indicators regarding its IT environmental footprint (CO2 emissions, % of second-hand devices used…).
In my database I have a list of indicators with different fields (name, value, type of indicator) and I want each user to have an individual value for each indicator.
Is there a way to link my indicator database with my user database or do I have to add every indicator as a field in my user database ?
Hi there, @g.masson1506… if a user is going to be creating a thing in the custom data type where you are storing the indicators, the indicators for that user will automatically be linked to the user through the built-in Created by field. If that field doesn’t work for you for some reason, you could add a field to the data type with a field type of User, and you could store the user who is associated with a set of indicators in that field. You could also go the other way and add a field to the User data type that links to the custom data type where the indicators are stored.
I understand what you mean but I’m not sure it’s answering my problem.
Correct me if I am wrong but with what you’ve explained, there will be hundreds of indicators in the database whereas I only want the database “list of indicators” to remain the same.
Moreover, with your way it seems that the user will have to create an indicator whereas I want him to be able to have the indicators ready right after his first connexion.
Is it possible to create a second database called “user’s indicators” in which, when a new user login, I make him create automatically a list of all the indicators available in my database “list of indicators” ?
Thanks again for you help !
Best regards,
Gauthier
Can you describe this database in more detail because I’m not sure why/if you need it.
It sounds like you might be able to go with a custom data type that has a field for each indicator you want the user to submit. Assuming one or more (if not all) of the indicators have predefined options, you could use option sets to define the options, and the fields in the custom data type would link to the option sets. Then, when a user signs up, you could have a step in the sign-up workflow that creates a new thing in the custom data type, and you should be good to go.
So, any of that make sense and sound like it could work for you?
To give you more details, my database is composed of 3 things :
the name of the indicator
the “good green IT practice” with which the indicator is linked (for example the indicator “weight of Electronic Device Waste avoided” is linked with the good practice “better handle the end of life of devices”)
the value of the indicator
For the second part of your message, thanks for making me discover option sets ahah. It is indeed going to simplify many things.
So if I understand correctly, if a create my list of indicators as an option sets, I will be able to create indicators for each user in my database “user’s indicators” thanks to this pre-defined list ?
This leads me to another question : if I have a list of 20 indicators as option sets. Is it possible to create the 20 indicators at once when the user signs up ? Or do I have to create 20 steps (one to create each new indicator) ?
Thanks for providing the details, @g.masson1506, and if I understand things correctly now, I’m not sure if using options sets is the best way to go.
It sounds like you have the full set of indicators saved in a custom data type, and you want to use that set of indicators as a template to create an identical set for each user when they sign up, right? If that is the case, one way you could go (which you have mentioned more than once) is to have a new data type that stores each user’s set of indicators. Because the template data type already has the name and “good green IT practice” for each indicator, you wouldn’t need fields for those things in the new data type. Rather, you could have a field that links to the template data type, and you would have another field where the user’s value would be stored.
With the above setup in place, you could use a backend/recursive workflow to create a set of things for each user when they sign up, and each thing in the set would link to a thing in the template. The backend/recursive workflow would create one thing at a time, but it would keep looping until it created a full set of things for the user who just signed up. Make sense?
I’m not sure that I have understood this part. Do you mean that in my new data type that stores user’s indicators I only have to create a field “user’s indicators” which has a type “list of indicators” ?
Note that the template data type doesn’t have a field for an indicator’s value because the values aren’t relevant in the template’s things. The second (user) data type has a field that links to the template data type so that each thing you create for a user in that data type is linked to its associated thing in the template data type. With that link in place, you don’t need fields for the name or “good green IT practice” in the second (user) data type because you can access that data through the link.