[Solved] how to display a number

I am trying to display how much money someone has in their in app wallet, but I can’t get it to display that figure.

Wallet is a data type
Balance is a number field
User is a field in the wallet
Privacy is set that the wallet’s creator can view all fields

I have put the box into a group, the group is set to wallet, that doesn’t work. I tried changing hte parent group to user, I tried changing several things, can’t seem to get it to work for it.

When I inspect it, it says parent group’s wallet is empty

Thanks!

Hello,

Questions. Have you set the database value as a number?
If yes, have you created a database value under the development branch?
If yes, have you set the parent group of the text to read current users info?

1 Like

If the inspector says the parent group’s wallet is empty, then that’s where the issue lies.

You’re obviously not defining the parent group’s wallet correctly, so take a look at that (and all parent elements) to see where the missing data is.

Feel free to share some more screenshots if you can’t find it yourself.

1 Like

Yes, database value is a number
Yes, I am running as a specific user, and they have a number balance
Yes, parent group is set to user, data source is current user

I have now changed the User type to have a Wallet field, and that has worked, but I thought there should be a way to show that information without having to do that?

Also, doing that, I have had to turn off the privacy for balance because I, as admin, had added the wallet data. Is there a way to keep the privacy while showing what the user would see for admin added data for a user?

When I try to do it via the wallet data type, I get this

I can see that the wallet is empty, but I can’t seem to get it to correctly source the data

When I try to, for instance making it so that the wallet to take the data from is the current user, I get this:

Clicking to use the first item of the list seems wrong as there is no list, there is only one owner, and it didn’t work anyway…

Changing the group type of content to User, data source current user

doesn’t work for this:


or this:


There is a list… a search ALWAYS returns a list (even if there’s only one item in it, or even zero - it’s still a list).

So selecting :first item is correct here.

If it’s not working, it must simply be that the data you’re searching for doesn’t exist, or privacy rules are preventing it being returned in the search. So check your database and privacy rules.

Having said that, from your previous screenshot I can see that the Wallet is stored on the User Datatype.

So just set the Group’s data source the Current User’s Wallet. That will not only be faster to load, but will cost less in WU as well, so better all round than doing a search.

1 Like

I definitely want it to cost less in WUs!!

Thanks

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