Hi Guys - kinda bamboozled here!!
I have an object that I want to show if value of X is greater than Y where the two values are stored in the same collection (as Storage Used & Quota Waring as numbers) but thats not working!
The rule works if I enter the second value manually any pointers, thanks.
Hi @Kamal thanks for the replyā¦
Apposed to a list item I am wanting to show the user a message (see attached) and whenever I try to map the Greater Than value via the collection - just donāt wanna work!
The logic seems pretty rudimentary to me, but just canāt get it to function without adding a āHard Valueā
That looks weirdā¦ I tried to re-create something similar based on my experiments app. Used a list of Cinemas, added Capacity and Actual properties (imagine this is nb of seats / bookings). The goal was to display warning sign if Actual > Capacity.
It worked:
As a crazy idea: may be you could try adding some test element (button/icon/etc) and try to change visibility of it?
Also, another idea: did you check how do you compare the numbers? I.e. in your case āwarningā should be shown when storage used is over 80%, so both properties should store %% of storage used. May be you compare %% with absolute number?
Hi @Victor thanks for the update - will try your suggestions but for reference the values are absolute numbers - I am just appending the % as text to the end in the UIā¦ My formula works out the used storage and I round it down to a simple number = ROUND((USEDBYTES / ALLOWANCEBYTES) x 100).
But will test using another UI item - like an Icon
Relationships of your collections and the properties.
The way you reach that screen which decides what data is pulled (to be available for use) in that screen.
Anyhow, I tried something simpler and it worked
In the users collection, added 2 number properties - āStorage usedā and āQuota Warningā.
Then, the conditional visibility works on any text label or button etc. For that particular logged in user, if used storage is greater than set warning, the warnign label is seen.
I am sure you would need some relationships from anotehr collection which pulls the data of storage used, that woudl require some trial and error testing.
Alternatively, you could just display that users current storage used and display on his/her profile the total usage and give different colours if it falls above the quota warning.
Hi @Kamalthanks for taking the time to reply
On the collection - then user click on to view their āStorageā I have an action that counts and calculates the usage of that user (based on the files owned by them) and then updates the Storage Collection. I have check this is working - and the Files count is updating the Storage collection but when using the formula as described in the UIā¦ not so!
For now I have hard coded the values, but was hoping to to have this more dynamic so it could be managed on a per-user basis, but will re-check my relationshipsā¦ As always Iāve mot likely missed something simple
Hi @Victor
Thanks for looking at this with me, appreciate your timeā¦ sorry for the late reply, yesterday I was jammed with real world issues like "accountsā
I have uploaded an explanation video (3:36 mins) not too long
Please take a look when you can, for now I have hard coded the values - but understanding where iāve gone wrong will really help.
Very interesting.
And whatās inside the āStorageā table? Youāre comparing that to sum of Quota Warning 1 -s, so whatās there?
Also, I assume you actually use āStorageā collection just for the clarity of DB structure, and you should never have more than 1 record for each Vendor there?
Hey @Victor
See attached the Storage collection - iām keeping details of the allowance and used space in bytes.
Yes in storage there is only one record for each Vendor else impossible to easily determine each vendors usage.
I suspect something though; sometimes when I used the functions like āSumā in a long-long relationship (like yours), they didnāt work correctly for me, so I had to choose the other way.
As an experiment and out of curiosity, could you put a label representing this Sum of āQuota Warning 1ā-s, and see what value will be displayed?
Also, the DB structure seems a bit overcomplicated, but I have to think a bit before suggesting smth.
hi @Victor thanks for taking a look, much appreciated
Ref the DB structure - the app is Multi user with Companies & Their own usersā¦ so just let the evolution of the thing dictate, but your feedback is helpful & Iāll take deeper look at the DB structure and see where i can tidy things up - thanks again