# Using postback and dynamic

**URL:** <https://developer.sailpoint.com/discuss/t/using-postback-and-dynamic/109873>\
**Category:** IIQ Discussion and Questions\
**Tags:** forms, workflows, identityiq\
**Created:** [April 9, 2025, 7:59pm UTC](https://developer.sailpoint.com/discuss/t/using-postback-and-dynamic/109873 "2025-04-09T19:59:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![arijindal](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@arijindal](https://developer.sailpoint.com/discuss/u/arijindal)\
**Post date:** [April 9, 2025, 7:59pm UTC](https://developer.sailpoint.com/discuss/t/using-postback-and-dynamic/109873/1 "2025-04-09T19:59:12Z")

</div>

i have a field that is a dropdown where a user can select an identity. i need the next field on the same form to be a dropdown of the capabilities that that identity has. how do i accomplish this using postback and dynamic?

---

<div class="post-metadata">

**Author:** ![pravin\_ranjan](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/pravin_ranjan/32/6771_2.png) [@pravin\_ranjan](https://developer.sailpoint.com/discuss/u/pravin_ranjan)\
**Post date:** [April 9, 2025, 8:18pm UTC](https://developer.sailpoint.com/discuss/t/using-postback-and-dynamic/109873/2 "2025-04-09T20:18:18Z")

</div>

@arijindal you have to add postback=“true” on first field and dynamic=“true” in second field.

let me know if you need samples.

---

<div class="post-metadata">

**Author:** ![arijindal](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@arijindal](https://developer.sailpoint.com/discuss/u/arijindal)\
**Post date:** [April 9, 2025, 8:29pm UTC](https://developer.sailpoint.com/discuss/t/using-postback-and-dynamic/109873/3 "2025-04-09T20:29:23Z")

</div>

what would the second field look like? below is my first field which works.

```
      <Field displayName="Workgroup" filterString="workgroup == true" name="remwg" postBack="true" required="true" type="sailpoint.object.Identity"/>

```

how do i get second field to only show capabilities that are in the identity/workgroup selected from the first field? below is what i have to start with for second field

---

<div class="post-metadata">

**Author:** ![arijindal](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@arijindal](https://developer.sailpoint.com/discuss/u/arijindal)\
**Post date:** [April 9, 2025, 8:31pm UTC](https://developer.sailpoint.com/discuss/t/using-postback-and-dynamic/109873/5 "2025-04-09T20:31:49Z")

</div>

its not letting me post what i have to start with for second field, but what i’m asking is how do i access the identity selected from the first field and also do i need a script? also, what should the type of the field be

---

<div class="post-metadata">

**Author:** ![pravin\_ranjan](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/pravin_ranjan/32/6771_2.png) [@pravin\_ranjan](https://developer.sailpoint.com/discuss/u/pravin_ranjan)\
**Post date:** [April 9, 2025, 9:41pm UTC](https://developer.sailpoint.com/discuss/t/using-postback-and-dynamic/109873/6 "2025-04-09T21:41:32Z")

</div>

check this thread

[Display and Get Field Values Dynamically in Form - IdentityIQ (IIQ) / IIQ Discussion and Questions - SailPoint Developer Community](https://developer.sailpoint.com/discuss/t/display-and-get-field-values-dynamically-in-form/83829)

you can get the value by

```auto
Field idn = form.getField("remwg");
idn.getValue will give you the value of field

```

---

<div class="post-metadata">

**Author:** ![arijindal](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@arijindal](https://developer.sailpoint.com/discuss/u/arijindal)\
**Post date:** [April 9, 2025, 9:54pm UTC](https://developer.sailpoint.com/discuss/t/using-postback-and-dynamic/109873/7 "2025-04-09T21:54:30Z")

</div>

import sailpoint.api.SailPointContext; import sailpoint.object.Identity; import sailpoint.object.Capability; import sailpoint.workflow.WorkflowContext;

```
              Identity w = context.getObjectById(Identity.class, remwg);
              List caps = w.getCapabilities();
              return caps;
              </Source>
          </Script>
        </AllowedValuesDefinition>
      </Field>

```

Ok so turns out i don’t need to user form.getField since remwg is already a workflow variable and i tested it and it dynamically updates when i select an identity for that field. Now for displaying the capabilities for that identity in the second field, everytime i try to use List caps = w.getCapabilities(); it breaks the form, essentially an error comes up and form doesn’t even show up. Why can’t I use getCapabilities() to access the capabilities of the selected identity?

---

<div class="post-metadata">

**Author:** ![pravin\_ranjan](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/pravin_ranjan/32/6771_2.png) [@pravin\_ranjan](https://developer.sailpoint.com/discuss/u/pravin_ranjan)\
**Post date:** [April 9, 2025, 10:02pm UTC](https://developer.sailpoint.com/discuss/t/using-postback-and-dynamic/109873/8 "2025-04-09T22:02:18Z")

</div>

try

```auto
Identity w = context.getObjectById(Identity.class, remwg);
log.error("w==="+w);
List caps = new ArrayList();
 if (w != null) caps = w.getCapabilities();
return caps;

```

---

<div class="post-metadata">

**Author:** ![arijindal](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@arijindal](https://developer.sailpoint.com/discuss/u/arijindal)\
**Post date:** [April 9, 2025, 11:11pm UTC](https://developer.sailpoint.com/discuss/t/using-postback-and-dynamic/109873/9 "2025-04-09T23:11:10Z")

</div>

> [@pravin\_ranjan](#):
>
> ```auto
> if (w != null) caps = w.getCapabilities();
> return caps;
> 
> ```

it worked, thank you

---

<div class="post-metadata">

**Author:** ![pravin\_ranjan](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/pravin_ranjan/32/6771_2.png) [@pravin\_ranjan](https://developer.sailpoint.com/discuss/u/pravin_ranjan)\
**Post date:** [April 10, 2025, 12:48pm UTC](https://developer.sailpoint.com/discuss/t/using-postback-and-dynamic/109873/10 "2025-04-10T12:48:32Z")

</div>

@arijindal nice, pls mark this was solved so it close this thread.

---

<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:** [June 9, 2025, 12:49pm UTC](https://developer.sailpoint.com/discuss/t/using-postback-and-dynamic/109873/11 "2025-06-09T12:49:17Z")

</div>

Closed on June 9, 2025, 12:49pm UTC

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