Trying to gain access to a datatype using User's Current User but I am getting 0


I am working on a calculation-intensive app and the architecture of the app simply is for a (sign up/login not implemented) user to fill a form, have the input details stored in a datatype(Inputs). Some calculations happens in the background which results in some other data type (Key Findings).

Data types for Inputs

Data types for Key Findings

So here’s my problem. On the Key Findings page, there’s an option to “Show Details” which requires doing some calculations with the Inputs data type and storing the calculations in a new Thing with the data type of Efficiency Details.

Data types for Efficiency Details

Upon research, I discovered that I can access database-stored Inputs using Current User and then adding Inputs as a data type field under User data type so I can access the values.

Empty User table because I didn’t implement sign up/login but noticed the column for Inputs

But that is failing because when I try to do the calculations with Input Fields, I get 0 as the value stored in my database.

Here’s the result of all the calculations as 0

Upon further research, someone mentioned that the problem could be my privacy rules. I made all the data types public but I still get 0 for the values of the Efficiency Details.

Another option I’ve considered is to just do the calculation in the dynamic data text. It works but I worry that I am not doing it right to cover all use cases and avoid one user getting the details of another user.

I really hope this was easy to follow. I’d appreciate any help I can receive. Thank you.

Have you used the debugger by appending ?debug_mode=true to your URL? That will tell you why values aren’t being stored. I’m guessing Current User’s Inputs is empty (i.e when you created an Input, you didn’t assign it to the Input field on the Current user).

Hi @georgecollier, yes, on using the debugger, I saw that the Current User’s Inputs is empty. Please how can I populate it?

Using the debugger and seeing Current User’s Inputs show empty

Thank you.

Create an Input, and make changes to Current User and set the Input field to result of step 1.

That worked, George. Thank you :pray:t5:

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