def post_process_dialog_submission(*, submission_data, template):
    """Process the ``submission`` data from a Slack dialog submission.

    Parameters
    ----------
    submission_data : `dict`
        The ``submission_data`` from the Slack dialog's event payload. Keys are
        the ``name`` attributes of fields. Values are the user contents of the
        fields, or the ``value`` attributes from select menus.
    template : `templatekit.repo.BaseTemplate`
        The corresponding template instance.

    Returns
    -------
    data : `dict`
        A cleaned-up copy of the ``submission_data`` parameter. See Notes
        for details of the post processing steps.

    Notes
    -----
    The following steps occur to process ``submission_data``

    - Drop any null values from select fields so that we get defaults from
      ``cookiecutter.json``.
    - Replace any truncated values from select fields with the full values.
    """
    # Drop any null fields so that we get the defaults from cookiecutter.
    data = {k: v for k, v in submission_data.items() if v is not None}

    for field in template.config["dialog_fields"]:

        if "preset_groups" in field:
            # Handle as a preset_groups select menu
            selected_label = data[field["label"]]
            for option_group in field["preset_groups"]:
                for option in option_group["options"]:
                    if option["label"] == selected_label:
                        for k, v in option["presets"].items():
                            data[k] = v
            del data[field["label"]]

        elif "preset_options" in field:
            # Handle as a preset select menu
            selected_value = data[field["label"]]
            for option in field["preset_options"]:
                if option["value"] == selected_value:
                    for k, v in option["presets"].items():
                        data[k] = v
            del data[field["label"]]

        elif field["component"] == "select":
            # Handle as a regular select menu
            try:
                selected_value = data[field["key"]]
            except KeyError:
                # If field not in data, then it was not set, so use defaults
                continue

            # Replace any truncated values from select fields with full values
            for option in field["options"]:
                if option["value"] == selected_value:
                    data[field["key"]] = option["template_value"]
                    continue

    return data