I am trying to: Sort users by User ID in descending order via a view.
I visited this URL:
I expected to see: In Views, I thought I could "Add a query filter to this View" by User ID, =< the current logged in user.
Instead, I got: No option to query by User ID exists.
I am sure the older versions of toolset has this but it is missing from my toolset which is the latest version.
If I cannot use this query, then do you have any suggestions? Thanks
Hello,
I’m Mohammed: the Toolset support team leader. I’ll give my best to help you to achieve your needs through Toolset components.
There an option to filter by specific post IDs (please check the attached screenshot)
But this will not filter by IDs that are greater than a specific value.
You can you a condition to achieve this in the loop output editor like the following:
[wpv-conditional if="( '[wpv-post-id]' gt '[wpv-user field='ID']' )"]
Display your results
[/wpv-conditional]
Please let me know if this works with you.
Thanks.
Hi Mohammed,
Actually it is User ID I need not Post ID. However, let me be specific about the actual need, maybe we can come up with something as I have been trying to figure this out for a week :). Bare with me a little.
This is how I have the requirement working in my head. This is based on a multi level referrer system, so person A refers B, B refers C, C refers D and so on...
Step 1: QUery list of all referrals in the Heirarchy for the user being displayed. So if this query is for person D above, then is would show C, B, A.
(This is where I was thinking of user ID in descending order).
Step 2: Check if a specific custom field in the referrer is empty. If empty, then move to the next refferer (again in descending order). If custom field found the display it.
Ex: C no CF > check B
B has CF - then display and end query.
Step 3: If no referrer has custom field, then display default (this part is easy).
On paper it seems pretty straight forward, simply check for custom field for each referrer of this user with an ID less than this user. However, I have not been able to achieve this in views as there is no USER ID query option (I think I could do it if there was).
Any help would be greatly appreciated.
Hi,
Could you try this using nested Views?
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/
You may create a View that lists users,
I the loop output, you can call another view that lists users.
You can pass the current user ID to the inner View via a shortcode parameter
Please check this as well: https://toolset.com/documentation/user-guides/passing-arguments-to-views/
Please let me know if this close to what you need.
Thanks.
Thanks I resolved this in a very different way to what I was expecting or what you described above 🙂