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

population of street attribute

Abdul_Gaffar
New Contributor II
New Contributor II

Hi ,

we have a target attributes that need to be concatenated in a single user attribute 

The target labels are not mutually exclusive , some have values and some do not

However , we tried by specifying as follows in importuser json 

"street": "if(street1!=null || street2!=null) then #CONST#${String data1 = response.operation.Street1; String data2 = response.operation.Street2; ret = data1 + \" \" + data2; return ret}"

 

please specify what shall be the corrections to be made for this mapping

 

Regards,

Abdul Gaffar

3 REPLIES 3

adriencosson
Valued Contributor
Valued Contributor

Hi @Abdul_Gaffar,

You might need to import your street attributes in customproperties using one to one mapping and then leverage the MODIFYUSERDATAJSON attribute of your connector to update the data accordingly. The below code assumes street1 is mapped with customproperty1 and street2 is mapped with customproperty2. Once the street attribute is updated, it will empty the customproperties.

{
   "ADDITIONALTABLES":{
      "USERS":"SELECT DISTINCT username, customproperty1, customproperty2 FROM USERS",
   },
   "COMPUTEDCOLUMNS":[
      "street",
      "customproperty1",
      "customproperty2",
   ],
   "TABLEINDEXES":{
      "CURRENTUSERS": [
         "username"
     ],
   },
   "PREPROCESSQUERIES":[
      "UPDATE NEWUSERDATA SET street = CASE WHEN customproperty1 is not null or customproperty2 is not null THEN CONCAT(customproperty1,' ',customproperty2) ELSE NULL END",
      "UPDATE NEWUSERDATA SET customproperty1 = NULL, customproperty2 = NULL",
   ]
}

 

Regards,
Adrien COSSON

Thank you @adriencosson  it is working

adriencosson
Valued Contributor
Valued Contributor

Glad it is working fine !

You can "Accept as Solution" the above answer 🙂

Regards,
Adrien COSSON