Hiding 'Null' Provisioning Form questions from being posted in Work Item

Which IIQ version are you inquiring about?

Version: 8.3p3

Please share any images or screenshots, if relevant.

Please share any other relevant files that may be required (for example, logs).

<ProvisioningForms>
    <Form name="Form - Microsoft Team with Guest Access Enabled">
      <Attributes>
        <Map>
          <entry key="pageTitle" value="Form - Microsoft Team with Guest Access Enabled"/>
        </Map>
      </Attributes>
      <Section label="Request Type" name="Section 1">
        <Field displayOnly="true" name="RoleRequested" reviewRequired="true" type="string" value="Form - Microsoft Team with Guest Access Enabled">
          <Attributes>
            <Map>
              <entry key="readOnly" value="true"/>
            </Map>
          </Attributes>
        </Field>
        <Field displayName="Does a new Microsoft team need to be created or existing one amended?" dynamic="true" name="requestType" postBack="true" required="true" reviewRequired="true" type="string">
          <AllowedValuesDefinition>
            <Value>
              <List>
                <String>Create a new team</String>
                <String>Amend an existing team</String>
              </List>
            </Value>
          </AllowedValuesDefinition>
        </Field>
      </Section>
      <Section name="newTeam">
        <Field displayName="Please provide the name of the team, this must start with &quot;External&quot;" dynamic="true" helpKey="e.g. External - M&amp;G Information Technology.  Due to file encryption policies, a new team must be created for you and your guests, we cannot alter an existing team." name="teamName" reviewRequired="true" type="string">
          <Attributes>
            <Map>
              <entry key="hidden">
                <value>
                  <Script>
                    <Source>

                      if (requestType != null @and requestType.equals("Create a new team")) {
                      field.setRequired(true);
                      return false;
                      }

                      field.setValue("");
                      field.setRequired(false);
                      return true;
                    </Source>
                  </Script>
                </value>
              </entry>
            </Map>
          </Attributes>
        </Field>
		</Section>

<!-- Additional questions excluded" -->

		<Section name="amendTeam">
        <Field displayName="What additional domain would you like to add?" dynamic="true" helpKey="e.g. @Microsoft.com" name="additionalDomain?" reviewRequired="true" type="string">
          <Attributes>
            <Map>
              <entry key="hidden">
                <value>
                  <Script>
                    <Source>

                      if (requestType != null @and requestType.equals("Amend an existing team")) {
                      field.setRequired(true);
                      return false;
                      }

                      field.setValue("");
                      field.setRequired(false);
                      return true;
                    </Source>
                  </Script>
                </value>
              </entry>
            </Map>
          </Attributes>
        </Field>
		</Section>
  </ProvisioningForms>

Share all details about your problem, including any error messages you may have received.

Hello all,

I am looking for guidance on how to exclude unanswered questions from the work item comments based on the options selected in the provisioning form within the role bundle object. Specifically, if the form contains 20 questions divided between two key options, is it possible to display only the ten questions related to the selected option in the work item, instead of all 20 questions?

I have included an excerpt of the provisioning form code I am using.

Thank you in advance for your assistance!

Best regards,
Ashley Sneddon

Hi @acgsneddon,

I see that your code contains snippet for hiding field. Is it not working, or you are looking for something specific that I am missing?

Thanks

Hi,

The script is successfully hiding questions that are not relevant based on the user’s selection. However, I would like to know if it’s possible to exclude any hidden questions from being displayed in the work item comments when the form is submitted.

Currently, the script displays both the answered questions and the hidden ones.

Hi @acgsneddon,
I’m not sure if it could be the point, but you could try to change the reviewRequired flag to false in the script.

Hi @Gares,
Thank you for the suggestion. I changed the reviewRequired flag from true to false and tested the form. Unfortunately, when selecting either option, the questions were no longer visible.

Hi Ashley,
Are you able to check the value of your question answer before creating workitem?

Thank you,
Prakash

Hello @Manish4031,
Could you please clarify how I should check the value before creating the work item?

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