Setting an initial user for pickerFieldUser

When creating a new record with a user field, I want the field the field to initially be set to the current logged in user.  I need to be able to clear that field and select a different user if applicable. 

In all of the functional variations I've tried, I can set a default value, but it will not allow me to change the selection.  If I click the X to clear the selection, it just repopulates with the logged-in user. 

I've tried variations of the following:

a!pickerFieldUsers(

label: "User",
labelPosition: "ABOVE",
maxSelections: 1,
value: if (

isnull(ri!record['recordType!{...}BWTA Event.fields.{...}user']),
loggedInUser(),
ri!record['recordType!{...}BWTA Event.fields.{...}user']

),
saveInto: ri!record['recordType!{...}BWTA Event.fields.{...}user'],
required: true,
validations: {}

),

I've reviewed many discussion threads, but either my available options do not match or they do not pertain to the create action.  

I reviewed this recipe, linked in a number of posts, Set the Default Value of an Input on a Start Form - Appian 23.1, but under the Process Modeler I do not see a "process start form" mentioned in step 3, nor am I prompted import rule inputs as in step 4.  All I see is the Start node and there are no relevant configuration options.

One thread mentioned the use of the statProcessLink, but I don't see how to configure the Create action button from the records list and thus I don't see any way to add context parameters to the Create action.

Any help appreciated...

Thanks.

  Discussion posts and replies are publicly visible

Parents Reply
  • I assumed the absence of buttonClicked was related to the aberrant behavior I described above.  

    Creating two localVariables, startUser and selectedUser, where the initial value of selectedUser is startUser seems to have corrected the issue.

    For posterity...

    a!localVariables(
      local!startUser: if (
        isnull(ri!record['recordType!{...}BWTA Event.fields.{...}user']),
        loggedInUser(),
        ri!record['recordType!{...}BWTA Event.fields.{...}user']
      ),
      local!selectedUser: local!startUser,
      a!formLayout(
        label: if(
          ri!isUpdate,
          "Update Event",
          "Create Event"
        ),
        contents: {
          a!columnsLayout(
            columns: {
              a!columnLayout(
                ...
              ),
              a!columnLayout(
                contents: {            
                  a!pickerFieldUsers(
                    label: "User",
                    labelPosition: "ABOVE",
                    maxSelections: 1,
                    value: local!selectedUser,
                    saveInto: local!selectedUser,
                    required: true,
                    validations: {}
                  ),
                  ...
                }
              )
            }
          )
        },
        buttons: a!buttonLayout(
          primaryButtons: {
            a!buttonWidget(
              label: if(ri!isUpdate, "Save", "Create"),
              submit: true,
              style: "PRIMARY",
              validate: true,
              saveInto: {
                a!save(
                  ri!record['recordType!{...}BWTA Event.fields.{...}user'],
                  local!selectedUser
                )
              }
            )
          }
        )
      )
    )

    THANKS!

Children
No Data