Skip to main content
Nintex Community Menu Bar

I hope I am completely overthinking this and that there is an easy & obvious answer šŸ™‚

Use Case - When a page that contains a table loads, I need to be able to apply the ā€œCurrent User Idā€ as the default filter value on a table (e.g. List Accounts Where Where OwnerId = $User.userId). Ā The filter field needs to be searchable and provide an ā€œAllā€ options as well. Ā In short, the records are filtered initially by the current user but the user can change the filter value and has visiblity to all ā€œUsersā€ in the system for searching as well as the ā€œAllā€ option.

Question - Is there a way to declaratively achieve this?

Things I’ve tried:
1) Looked for a way to apply a default value to an automatic table filter - No dice
2) Tried using a manual filter who’s default condition value is the current UserId but model conditions with ā€œSpecific Valueā€ don’t apply merge syntax and treat the value as a string literal
3) Tried using a combination of conditions and models and the ā€œAdd Effectā€ feature of table filters to turn off/on different conditions but no dice

Am I overlooking a declaritive way to do this or is javascript the only answer?

I’m not sure if you’ve tried this, but have tried setting the condition the current user and setting this condition as ā€œDefault Onā€? This way the filter can override when chosen by the user.


Hey Pat - Thanks for this. Ā Yeah, tried that. Ā The problem is that to do that, you have to use either the ā€œUserā€ merge property or ā€œField from another modelā€ property. Ā The table filter needs ā€œSpecific Valueā€ so they don’t work together as needed. Ā You could have two conditions and deactivate one when someone searches in the table but then the search field itself in the table won’t show the users name on page load because it’s two different conditions. Ā Since you can’t use merge syntax in a model condition of Specific Value, you can’t use it that way either other than a JS based solution.Ā 

Maybe I’m overthinking?


Do you have Name in the model that’s providing the User Id? I’ve seen including this make a difference when creating new records with Default Lookup values.


Yep, Name & Id in the model that is being used as a source. Ā 

The challenge I’m having is getting the current User Id in to the condition on the Account model. Ā You can’t use specific value to do this but the table filter must be applied against a condition set to ā€œSpecific value.ā€

Only thing I’ve come up with is a JS solution and while it works, doing something this trivial shouldn’t require JS 😦


I would cheat and put two versions of the table in a tab set set to picklist. I would name the first tab ā€œMy Recordsā€ and name the second tab ā€œAll Recordsā€. I would put Table 1 in tab 1 and set the table to Model 1. I would put Table 2 in Tab 2 and set it to Model 2. I would set a condition on Model 1 to be only owner=current user. I would put a multi option filter on Table 2 on the owner field. Then, if it didn’t work, I would ask you for that neat JS solution! šŸ˜‰


Creative solution Raymond. Ā That actually would technically work I believe. Ā That said, I think your users must be a lot more forgiving than mine - mine would scream and yell at having to go to two places for the same data šŸ™‚


And then I’d scream and yell cause I have two table configurations to maintain lol

Queue Up - Reusable comments plug - Vote here -Ā https://community.skuid.com/t/improve-re-usability-of-components-action-sequences-etcĀ :)


Haha… The things I’ll do to avoid learning JS!


and I voted for your cloning components… I would LOVE that.


Yeah, being able to reuse a component configuration would rock and be something I think lots of people would find significant value in.

My pages are so complicated that without ā€œre-useā€ there’s no way we’d get the app off the ground. Ā For example, I need to show the same ā€œfield editorā€ in 3 different places on the same screen. Ā The field editor is incredibly complex with search fields, filters, conditional rendering, etc. Ā I’ve built a custom solution to ā€œre-useā€ a component but it has limitations. Ā Having this feature in the core product would be groundbreaking IMHO.


Skuid Team - Any way to accomplish this short of a JS solution?


Barry,

I don’t know if this is ok for your use case, but you can add a tab and place your table inside of the tab. Ā Then add a tab action when the tab is first shown to set your filter to the current user. Ā This allows the user to change it from then on.

Thanks,

Bill


Hey Bill -

Very creative, love the idea! Ā In my case, I ended up going with a JS based solution and it’s working as needed. Ā Still, seems to me like something that should be available without the need for JS and/or creative declaritive solutions such as the one you proposed.

I created a few posts to ask for these features. Ā Feel free to vote if you agree šŸ™‚

  1. Applying a default value to a table filter that is based on reference field
  2. Manual filter source using rows from model should requery model on search
  3. Apply default value for automatic table filter
  4. Support merge syntax on model condition specified value(s)