MySource Matrix Developer

Main Content

Pre-Fill Form Questions with Current User Information

Summary

This specification proposes to allow the default values of a question to be based upon a keyword replacement for the currently logged in user.

Status: Approved Proposal
Key: draft -> approved proposal -> scheduled -> in development -> in testing -> complete -> released

This feature is not scheduled for development

Planned Release Version: 3.10.0 RC1

Problem Definition

Functionality is desired in the Custom Form asset to pre-fill a form's questions with information relating to the user currently logged in at the time of filling in the form. Such information could include fields such as first/last name and email address. This could be extended to other keywords relating to the current user, such as metadata.

Technical Specification

This functionality will be limited to Text Form Question assets, and those that extend it (eg. Email Address). Note that the Numeric Form Question type will be excluded, as there are no meaningful fields of numeric format that could be applied to this type of question.

The functionality will be implemented by allowing additional 'current user' keywords to be added to the Default attribute of a form question. These keywords will be replaced with values relating to the user logged in at the time when the form is displayed.

If no user is currently logged in, the default value should remain blank instead of being pre-filled with the Public User's information.

The keywords will be prefixed with 'current_user' instead of 'asset' to ensure there is no confusion as to what the keywords apply to. For example, the keyword will be used in place of Pre-Fill Form Questions with Current User Information.