For a New Task Page, default Assigned to to Current User

  • 1
  • Question
  • Updated 4 years ago
  • Answered
Hi all, 

I am creating pages for creating new tasks - one general and one for a "log a call" scenario which have some meta-data pre-populated specific to call tasks. 

How can I automatically populate the "assigned to" field with the name of the user performing the action? 

I have reviewed this similar thread (https://community.skuidify.com/skuid/topics/defaulting-task-owner-to-the-current-user) but it seems to apply to creating a record inline in a table as opposed to a "new" page, and I can't see where I would apply this merge field as a default. 

Thanks!
Photo of Justin Norris

Justin Norris

  • 782 Points 500 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,004 Points 20k badge 2x thumb
For a "New Task" page, it's very easy --- just add a Condition on your new Task Model on the OwnerId field, with the value set to the User Id property of the Running User:



This Condition will be applied to the auto-created new Task record in your Model.
Photo of Justin Norris

Justin Norris

  • 782 Points 500 badge 2x thumb
Hey Zach, 

I was trying this but the one challenge is if 10% of the time, someone wants to create a task for someone else. 

It seems like when I use model conditions for field defaults then it enforces it and prevents the user from selecting any other value. 

Is there a way of populating a value as the initial state for the field then allowing the user to over-ride it if they wish? 

Thanks for the quick response!
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,004 Points 20k badge 2x thumb
Yeah that should be fine, the Condition in this scenario will only be used as a default value, but if you include the OwnerId field in a Field Editor in Edit mode in your New Task page, your users should be able to override the default Owner.
Photo of Justin Norris

Justin Norris

  • 782 Points 500 badge 2x thumb
Oh hey it worked. I had to use the Owner.Name field to get the name instead of the ID but then it worked like a charm. I swear last night it was changing it back on me but today it allowed me to over-ride it. 

Perfect! Thanks a lot.