Batch Workflow - Request Form

Hello,

Since it is not possible to edit the table of a “Select Profile” action in a batch workflow, we are exploring a workaround. Our approach is to add a request form immediately afterward, where more details can be displayed before the performer submits the workflow.

Additionally, we need to keep the “Create a new request for each profile selected” option disabled, as we trigger a sub-workflow for each selected profile.

According to this post, I understand that it is possible to use Liquid language to display information on a request form about what a performer selected in previous steps.

We attempted to create a form to display the non-employee display name, along with its start and end date. However, the challenge is ensuring that this information appears on the request form only for the profiles that are selected.
Not sure about the API call running on the backend when selecting profiles however, we tried using the for iteration within the profiles table to retrieve and display the information like below:

{% for profile in profiles %}
                <tr>
                    <td>{{ profile.name }}</td>
                    <td>{{ attributes.assignment_start_date }}</td>
                    <td>{{ attributes.assignment_end_date }}</td>
                </tr>
            {% endfor %}

Unfortunately, this approach does not seem to work, as no information is displayed.

Does anyone have experience or insights on how to retrieve and use the information from selections made during a “Select Profile” action in batch workflows?

Thank you in advance.

Hey Anna - you are so close!! I will add this to the post you linked, but what you are missing is the key to access the profiles in a Batch workflow. Batch workflow profiles are in the request object. Like so: {{ request.profiles }}

Example liquid/request form config:

<style>
th, td {
  padding: 15px;
text-align:left;
}
table, th, td {
  border: 1px solid black;
}
</style>
<table>
<tr>
    <th>ID</th>
    <th>Name</th>
  </tr>
{% for profile in request.profiles %}
<tr>
    <td>{{ profile.id}}     </td>
    <td>{{ profile.name }}</td>
</tr>
{% endfor %}
</table>

This would output as:

You could also use the built in Tablerow loop iteration for Liquid to generate tables

1 Like

Thank you very much, Zachary.
Indeed, by using request.profiles, I was able to retrieve the name and ID of the selected profiles.
Additionally, it seems I was also attempting to access the attributes associated with a profile in the wrong way.

My initial assumption was to use {{profile.attributes.attribute_name}}, but it turns out the correct approach is to use {{profile.attribute_name}}.

In conclusion, the following worked perfectly:

  <tbody>

            {% for profile in request.profiles %}
                <tr>
                    <td>{{ profile.name }}</td>
                    <td>{{ profile.assignment_start_date }}</td>
                    <td>{{ profile.assignment_end_date }}</td>
                    <td>{{ profile.non-employee_sponsor }}</td>
                </tr>
            {% endfor %}
            
        </tbody>

Thanks a lot :slight_smile:

1 Like

As a follow up the only issue that we continue facing is that if we set “Create a new request for each profile selected” as disable the table is not populated with the required values.
We are getting an empty table.
Ideally we would like to have “Create a new request for each profile selected” enabled, since on a later action we trigger a sub-workflow for each selected profile.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.