Load Current User into a field on the form load

Hi!

I tried to create the following form action to set a field with the current user , but it didn't work:



there is an old AppScript in the project being used to set the user for such cases, but honestly, I don't think we need an AppScipt to do that and I believe in the low code options that we have in the SBM.

Thanks!

.

Parents
  • Verified Answer

    +1  

    I would think that form action should  work unless there might be an issue with a searchable user field or the user not available in the list.  Is the user selectable in the field without the form action?

    There is a couple of ways without an appscript. You could set the default in Web Admin for the transition:

    If it is a searchable field, you could maybe make non-searchable (if possible) or you could select to create a form action "Execute Javascript" and do the following, as it forces the search on the field:


    SetFieldValue("Data Entry Specialist", \{'id':{_UserId}, 'name':'{_UserName}')

  • Verified Answer

    +1 in reply to   

      Thanks for the reply! Can I know where can I find that screenshot in the admin portal please? and where can I find such that javascript examples? I didn't find it the sbms_js_library.pdf documentation

  • Verified Answer

    +1   in reply to 

    For setting user defaults, you can also set them at the workflow in the Application Administrator.

    "Application Administrator > Workflows > [Your Workflow] > States/Transitions > [Your Transition]  Details > Fields > [Data Entry Specialist] Details > Set Allow Override & Set to Value to Default Value > Manage Group Users Default"

Reply
  • Verified Answer

    +1   in reply to 

    For setting user defaults, you can also set them at the workflow in the Application Administrator.

    "Application Administrator > Workflows > [Your Workflow] > States/Transitions > [Your Transition]  Details > Fields > [Data Entry Specialist] Details > Set Allow Override & Set to Value to Default Value > Manage Group Users Default"

Children
No Data