Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Multi value in Dynamic Attribute in FORM

Rajatlm10
New Contributor III
New Contributor III

How we can utilize values selected as part of multi select in dynamic attribute in form? 

{
    "roles":{
        "primary_role":{
            "role":"[B2B] Insights"
            }
        },
"data-access": {
    "organization": [
      {
        "data_view": "xyz Corporation",
        "unit_group": "unittype_b2b_account",
        "unit_group_display_name": "Account",
        "role": "[B2B] Insights"
      },
 {
        "data_view": "xyz Corporation",
        "unit_group": "GTMU1",
        "unit_group_display_name": "GTMU1",
        "role": "[B2B] Insights"
      },
 {
        "data_view": "xyz Corporation",
        "unit_group": "GTMU2",
        "unit_group_display_name": "GTMU2",
        "role": "[B2B] Insights"
      }
    ],
    "segments": [
      {
        "data_view": "xyz Corporation",
        "role": "[B2B] Insights",
        "field": "k_bp_development_cycle_flag_combined_alt",
        "field_display_name": "Development Cycle",
        "option": "Live"
      }
    ]
  },
"username":"john.doe@xyz.org",
"email":"john.doe@xyz.org",
"company_account_id":"r773W",
"first_name":"John",
"last_name":"Doe",
"login_blocked": "true"
}

 

14 REPLIES 14

rushikeshvartak
All-Star
All-Star

Can you elaborate your requirement


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Rajatlm10
New Contributor III
New Contributor III

@rushikeshvartak  Please find the elaboration below:

 

We have configured dynamic attributes in the form. One of the dynamic attribute is multi select. It needs to be sent in the above payload.
If only 1 is selected, then we need to pass only 1 in the payload. If more than 1 are selected, then we need to pass  all the values in the payload.
Let’s say GTMU1 and GTMU2 were selected in the form, then the load will look like above. But if only GTMU1 is selected, then it will be as below-
form? 

Note - Role information is coming from form (DA) as well. We have hardcoded as of now.

{
    "roles":{
        "primary_role":{
            "role":"[B2B] Insights"
            }
        },
"data-access": {
    "organization": [
      {
        "data_view": "xyz Corporation",
        "unit_group": "unittype_b2b_account",
        "unit_group_display_name": "Account",
        "role": "[B2B] Insights"
      },
 {
        "data_view": "xyz Corporation",
        "unit_group": "GTMU1",
        "unit_group_display_name": "GTMU1",
        "role": "[B2B] Insights"
      }
    ],
    "segments": [
      {
        "data_view": "xyz Corporation",
        "role": "[B2B] Insights",
        "field": "k_bp_development_cycle_flag_combined_alt",
        "field_display_name": "Development Cycle",
        "option": "Live"
      }
    ]
  },
"username":"john.doe@xyz.org",
"email":"john.doe@xyz.org",
"company_account_id":"r773W",
"first_name":"John",
"last_name":"Doe",
"login_blocked": "true"
}

Ok this needs to be passed from create account json ? if yes send draft JSON 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

If GTMU1 is passed in DA -


{ "accountIdPath": "call1.message.username", "call": [ { "name": "call1", "connection": "acctAuth", "url": "https://XXX/admin/v1/users", "httpMethod": "POST", "httpParams": "{\"roles\":{\"primary_role\":{\"role\":\"${requestAccessAttributes.get('primaryRole')}\"}}, "data-access": { \"organization\": [ { "data_view\": \"ABC Corporation\", \"unit_group\": "unittype_b2b_account", "unit_group_display_name": "Account", "role": \"${requestAccessAttributes.get('primaryRole')}\" }, { \"data_view\": \"ABC Corporation\", \"unit_group\": \"GTMU1\", \"unit_group_display_name\": \"GTMU1\", \"role\": \"${requestAccessAttributes.get('primaryRole')}\" } ], "segments": [ { \"data_view\": \"ABC Corporation\", \"role\": \"${requestAccessAttributes.get('primaryRole')}\", \"field\": \"k_bp_development_cycle_flag_combined_alt\", "field_display_name": "Development Cycle", \"option\": \"Live\" } ] }, \"username\":\"${user.email}\",\"email\":\"${user.email}\,\"company_account_id\":\"${user.username}\,\"first_name\":\"${user.firstname}\",\"last_name\":\"${user.lastname}\",\"login_blocked\": true}", "httpHeaders": { "Authorization": "${access_token}", "Accept": "application/json" }, "httpContentType": "application/json", "successResponses": { "statusCode": [ 200 ] } } ] }

 

 

 

If GTMU1.GTMU2 is passed in DA -

 

{ "accountIdPath": "call1.message.username", "call": [ { "name": "call1", "connection": "acctAuth", "url": "https://XXX/admin/v1/users", "httpMethod": "POST", "httpParams": "{\"roles\":{\"primary_role\":{\"role\":\"${requestAccessAttributes.get('primaryRole')}\"}}, "data-access": { \"organization\": [ { \"data_view\": \"ABC Corporation\", \"unit_group\": "unittype_b2b_account", "unit_group_display_name": "Account", "role": \"${requestAccessAttributes.get('primaryRole')}\" }, { \"data_view\": \"ABC Corporation\", \"unit_group\": \"GTMU1\", \"unit_group_display_name\": \"GTMU1\", \"role\": \"${requestAccessAttributes.get('primaryRole')}\" },{ \"data_view\": \"ABC Corporation\", \"unit_group\": \"GTMU2\", \"unit_group_display_name\": \"GTMU2\", \"role\": \"${requestAccessAttributes.get('primaryRole')}\" } ], "segments": [ { \"data_view\": \"ABC Corporation\", \"role\": \"${requestAccessAttributes.get('primaryRole')}\", \"field\": \"k_bp_development_cycle_flag_combined_alt\", "field_display_name": "Development Cycle", \"option\": \"Live\" } ] }, \"username\":\"${user.email}\",\"email\":\"${user.email}\,\"company_account_id\":\"${user.username}\,\"first_name\":\"${user.firstname}\",\"last_name\":\"${user.lastname}\",\"login_blocked\": true}", "httpHeaders": { "Authorization": "${access_token}", "Accept": "application/json"}, "httpContentType": "application/json", "successResponses": { "statusCode": [ 200 ] } } ] }

  • Does it works when hardcoded value ?
  • Are you facing issue when doing dynamic ? if yes share logs
  • ‼️‼️⚠️Keep company-specific private information masked on public forums, such as the name and URL.⚠️‼️‼️

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

It works when hardcoded and we are not facing issue with dynamic attribute. We need to pass the values separately that are selected in the multi select dynamic attribute.

We need to take comma separated values and pass it individually in the payload as expected

You can use substring and pass to call1 and second to call 2


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Rajatlm10
New Contributor III
New Contributor III

@rushikeshvartak 

We will have to use that for each value selected in dropdown. Since requestor can select more than 2 (up till 14), is there any other alternate?

None


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Rajatlm10
New Contributor III
New Contributor III

We are using the below substring but it's not working. 

dynamicAttributes.get('GTMU1').substring(0, (dynamicAttributes.get('GTMU1')).indexOf(','))

dynamicAttributes.get('GTMU1').split(',')[0]

 

attaching the JSON for reference.

Can you share sample value and expected output


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

The jsons shared are a combination of both the below 2 situations

Is attribute name is   unit_group?

Can you make bold what are changes per use case?


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Ran
New Contributor
New Contributor

Yes, the attribute name is   unit_group. Attached the updated scenarios with unit_group changes in bold.