If you need to get the user running a dialog or an on-demand workflow you might be surprised that this is not available as a dynamic value. However, if your dialog or on-demand workflow creates or modifies a record, then you can get the current user.
For example, you have a dialog that creates a phone call and you need to set the sender of the phone call to the current user.
- In the dialog editor, add a Create Phone Call record step.
- Click Set Properties.
- Update the record as required, but leave Sender blank.
- Add an Update Record step and reference the Phone Call created in the previous step.
- Click Set Properties.
- In the Update Phone Call window:
- Click in Sender.
- In the Form Assistant in Look For, under Local Values, select Create(Phone Call).
- In the box below Look for, select Created By.
Since dialogs run in the context of the user that starts the dialog, the phone call is created by the current user. If the dialog does not create a record but modifies one, then you can get the current user from the Modified By field of the record.
This also works for on-demand workflows but not automatic workflows. Automatic workflows run in the context of the person that created the workflow.