# FieldName: Not a Valid Parameter Error

**URL:** <https://developer.sailpoint.com/discuss/t/fieldname-not-a-valid-parameter-error/82510>\
**Category:** IIQ Discussion and Questions\
**Tags:** forms, workflows, identityiq\
**Created:** [September 23, 2024, 1:47pm UTC](https://developer.sailpoint.com/discuss/t/fieldname-not-a-valid-parameter-error/82510 "2024-09-23T13:47:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![shruthi\_m](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@shruthi\_m](https://developer.sailpoint.com/discuss/u/shruthi_m)\
**Post date:** [September 23, 2024, 1:47pm UTC](https://developer.sailpoint.com/discuss/t/fieldname-not-a-valid-parameter-error/82510/1 "2024-09-23T13:47:21Z")

</div>

In one of my custom form I have configured custom fields to display identity list. whenever I touch the identity list dropdown it throws exception.

Could anyone help?

I have attached the rule part and error screen and ui view for reference.

Rule part:

```auto

<Field columnSpan="4" dependencies="selection,userId" displayName="Application" dynamic="true" hidden="true" name="ownedObjectsSingle" postBack="true" type="object">
            <Attributes>
              <Map>
                <entry key="hidden" value="script:return form.getField(&quot;selection&quot;).getValue().equals(&quot;Bulk&quot;);"/>
              </Map>
            </Attributes>
            <Script>
              <Source>
                import sailpoint.object.Application;
                import sailpoint.object.QueryOptions;
                import sailpoint.object.Filter;
                import sailpoint.object.Identity;
                import sailpoint.object.Field;  
                import sailpoint.object.Form;
                import sailpoint.object.Form.Section;

                try {

                String selectionValue = form.getField("selection") != null ? (String) form.getField("selection").getValue() : "";
                if (!"Bulk".equals(selectionValue)) {
                String content ="";
                String userId = form.getField("userId") != null ? (String) form.getField("userId").getValue() : "Adam.Kennedy";
                Identity selectedUser = context.getObjectByName(Identity.class, userId);

                if (selectedUser != null) {
                QueryOptions appQueryOptions = new QueryOptions();
                appQueryOptions.addFilter(Filter.eq("owner", selectedUser));
                List applicationsList = context.getObjects(Application.class, appQueryOptions);

                Section section = form.getSection("ownedObjectsSection");

                section.setColumns(4);

                if (applicationsList != null &amp;&amp; !applicationsList.isEmpty()) {
                for (Application app : applicationsList) {

                Field f = new Field();
                f.setType(Field.TYPE_BOOLEAN);
                f.setName("app_" + app.getName());
                f.setDisplayName(app.getName());
                f.setValue(false); 
                f.setColumnSpan(2);
                section.add(f);

                String description = "No description available";
                Map descriptions = app.getDescriptions();

                if (descriptions != null) {
                if (descriptions.containsKey("en")) {
                description = descriptions.get("en");
                } else if (!descriptions.isEmpty()) {
                description = descriptions.values().iterator().next();
                }
                }

                // Add the description below the application name with proper indentation and italic styling
                content += "&lt;div style='margin-left: 40px; font-style: italic;'>";
                content += "Description: " + description;
                content += "&lt;/div>";

                Field identityField = new Field();
                identityField.setType(Field.TYPE_IDENTITY);
                identityField.setName("identitySingle" + app.getName());
                identityField.setDisplayName("");
                identityField.setFilterString("inactive==true");
                identityField.setValue("");
                identityField.setColumnSpan(2);
                section.add(identityField);

                }
                } else {
                log.error("No applications found for this user");
                }

                } else {
                log.error("User not found: " + userId);
                }
                } else {
                log.info("Selection is Bulk, skipping application objects generation.");
                }
                } catch (Exception ex) {
                log.error("Error retrieving data: " + ex.getMessage());
                }

              </Source>
            </Script>
          </Field>

```

Ui VIew:

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/b/1/b1a19c4ca0261b532461c0fbc3e8544f4fb1f111.png)

Error Message:

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/7/0/70312a61801bfbdbf675a608dc2c3b64e24fa9a3.png)

---

<div class="post-metadata">

**Author:** ![vinnysail](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vinnysail/32/17001_2.png) [@vinnysail](https://developer.sailpoint.com/discuss/u/vinnysail)\
**Post date:** [September 23, 2024, 2:07pm UTC](https://developer.sailpoint.com/discuss/t/fieldname-not-a-valid-parameter-error/82510/2 "2024-09-23T14:07:00Z")

</div>

Hi @shruthi_m  
Can you please check the below things once

Ensure that the field name specified in form.getField(“fieldname”) matches exactly with the name attribute of the corresponding element in your form XML.

Use form.getFieldValue(“fieldname”) instead of form.getField(“fieldname”).getValue(). The getFieldValue() method directly retrieves the value of the specified field without requiring an additional .getValue() call.

Double-check for any typos or case sensitivity issues or null checks

---

<div class="post-metadata">

**Author:** ![ashutosh08](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ashutosh08/32/11459_2.png) [@ashutosh08](https://developer.sailpoint.com/discuss/u/ashutosh08)\
**Post date:** [September 23, 2024, 3:22pm UTC](https://developer.sailpoint.com/discuss/t/fieldname-not-a-valid-parameter-error/82510/3 "2024-09-23T15:22:26Z")

</div>

Hi @shruthi_m,

Can you check the log trace and if possible, share the same to get more insight into the issue?

Thanks

---

<div class="post-metadata">

**Author:** ![shruthi\_m](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@shruthi\_m](https://developer.sailpoint.com/discuss/u/shruthi_m)\
**Post date:** [September 23, 2024, 3:25pm UTC](https://developer.sailpoint.com/discuss/t/fieldname-not-a-valid-parameter-error/82510/4 "2024-09-23T15:25:31Z")

</div>

Error log

[form error.log](https://developer.sailpoint.com/discuss/uploads/short-url/ePdkNiAXL4hCQYObj4LNR6pizUu.log) (8.9 KB)

---

<div class="post-metadata">

**Author:** ![officialamitguptaa](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/officialamitguptaa/32/6624_2.png) [@officialamitguptaa](https://developer.sailpoint.com/discuss/u/officialamitguptaa)\
**Post date:** [September 23, 2024, 4:11pm UTC](https://developer.sailpoint.com/discuss/t/fieldname-not-a-valid-parameter-error/82510/5 "2024-09-23T16:11:51Z")

</div>

Hi Shruthi,

To boil down the problem, Could you comment the new field creation code in your rule and retry if it works.

```auto
<Field columnSpan="4" dependencies="selection,userId" displayName="Application" dynamic="true" hidden="true" name="ownedObjectsSingle" postBack="true" type="object">
            <Attributes>
              <Map>
                <entry key="hidden" value="script:return form.getField(&quot;selection&quot;).getValue().equals(&quot;Bulk&quot;);"/>
              </Map>
            </Attributes>
            <Script>
              <Source>
                import sailpoint.object.Application;
                import sailpoint.object.QueryOptions;
                import sailpoint.object.Filter;
                import sailpoint.object.Identity;
                import sailpoint.object.Field;  
                import sailpoint.object.Form;
                import sailpoint.object.Form.Section;

                try {

                String selectionValue = form.getField("selection") != null ? (String) form.getField("selection").getValue() : "";
                if (!"Bulk".equals(selectionValue)) {
                String content ="";
                String userId = form.getField("userId") != null ? (String) form.getField("userId").getValue() : "Adam.Kennedy";
                Identity selectedUser = context.getObjectByName(Identity.class, userId);

                if (selectedUser != null) {
                QueryOptions appQueryOptions = new QueryOptions();
                appQueryOptions.addFilter(Filter.eq("owner", selectedUser));
                List applicationsList = context.getObjects(Application.class, appQueryOptions);

                Section section = form.getSection("ownedObjectsSection");

                section.setColumns(4);

                if (applicationsList != null &amp;&amp; !applicationsList.isEmpty()) {
                for (Application app : applicationsList) {

                //Field f = new Field();
                //f.setType(Field.TYPE_BOOLEAN);
                //f.setName("app_" + app.getName());
                //f.setDisplayName(app.getName());
                //f.setValue(false); 
                //f.setColumnSpan(2);
                //section.add(f);

                String description = "No description available";
                Map descriptions = app.getDescriptions();

                if (descriptions != null) {
                if (descriptions.containsKey("en")) {
                description = descriptions.get("en");
                } else if (!descriptions.isEmpty()) {
                description = descriptions.values().iterator().next();
                }
                }

                // Add the description below the application name with proper indentation and italic styling
                content += "&lt;div style='margin-left: 40px; font-style: italic;'>";
                content += "Description: " + description;
                content += "&lt;/div>";

                //Field identityField = new Field();
                //identityField.setType(Field.TYPE_IDENTITY);
                //identityField.setName("identitySingle" + app.getName());
                //identityField.setDisplayName("");
                //identityField.setFilterString("inactive==true");
                //identityField.setValue("");
                //identityField.setColumnSpan(2);
                //section.add(identityField);

                }
                } else {
                log.error("No applications found for this user");
                }

                } else {
                log.error("User not found: " + userId);
                }
                } else {
                log.info("Selection is Bulk, skipping application objects generation.");
                }
                } catch (Exception ex) {
                log.error("Error retrieving data: " + ex.getMessage());
                }

              </Source>
            </Script>
          </Field>

```

---

<div class="post-metadata">

**Author:** ![shruthi\_m](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@shruthi\_m](https://developer.sailpoint.com/discuss/u/shruthi_m)\
**Post date:** [September 24, 2024, 5:44am UTC](https://developer.sailpoint.com/discuss/t/fieldname-not-a-valid-parameter-error/82510/6 "2024-09-24T05:44:47Z")

</div>

The whole part of the form is working really fine. Only new field creation step is causing the problem. If i comment all the new field creation line there is nothing to display.

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/a/6/a693c04696f438b078150f6e0aa0df6b3cd156a9.png)

---

<div class="post-metadata">

**Author:** ![Arun-Kumar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/arun-kumar/32/15128_2.png) [@Arun-Kumar](https://developer.sailpoint.com/discuss/u/Arun-Kumar)\
**Post date:** [September 24, 2024, 6:07am UTC](https://developer.sailpoint.com/discuss/t/fieldname-not-a-valid-parameter-error/82510/7 "2024-09-24T06:07:21Z")

</div>

Hi @shruthi_m ,

This is causing the issue. You can comment out the line below and see if that helps.

```auto
identityField.setType(Field.TYPE_IDENTITY);

```

---

<div class="post-metadata">

**Author:** ![shruthi\_m](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@shruthi\_m](https://developer.sailpoint.com/discuss/u/shruthi_m)\
**Post date:** [September 24, 2024, 6:47am UTC](https://developer.sailpoint.com/discuss/t/fieldname-not-a-valid-parameter-error/82510/8 "2024-09-24T06:47:03Z")

</div>

No it’s not working. if i comment this line, Field is not displaying. if i uncomment this line, i’m getting the same error

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [November 23, 2024, 6:47am UTC](https://developer.sailpoint.com/discuss/t/fieldname-not-a-valid-parameter-error/82510/9 "2024-11-23T06:47:39Z")

</div>

Closed on November 23, 2024, 6:47am UTC

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