Set User Model Id to running user ONLY if no URL parameter provided on the skuid page?

We have a use case where we want to set the user model id to a url parameter "teammember" but if this is not provided at all then use the usual running user as the Id

It will allow us to them use one page for a dashboard with charts on running user or their team mates if necessary

Cant seem to find a workaround.

Any ideas would be appreciated

Answers

  • Rob HatchRob Hatch 💎💎💎
    edited August 6, 2020

    I think you will need to do the following.

    1. Set User model NOT to load on page load. (and probably cascade that down to other models that depend on the User model)
    2. Create an "on page load" action sequence that branches on the parameter. (page parameters are accessible in merge syntax in branching formulas). One branch sets user model condition to "teammember" the other sets it to "{{$User.userId}}" - after setting the condition each branch queries the model...

    After that - all that's left to do is bask in the adulation of your fans....

    Let me know if this sketch doesn't make sense.

  • That sounds like a perfect solution!

    Thanks again.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!