Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

Preprocessor JSON for email update

K_India
New Contributor III
New Contributor III

When I am importing a user from csv file, I want preprocessor JSON query such that at 1st time when I import new user from csv file it has many fields like username, firstname , last name , EMAIL etc. so all field should be imported.

then when I update that user from csv file import  which has some filed updated like firstname is changed, last name is changed, city is changed , also email is changed.

I want json preprocessor query in a way that all field should be updated except EMAIL field. 

EMAIL should be forcefully not updated, even in csv file it is change then too I want EMAIL to be not updated.

 

Please help how it is possible ??

 

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

You can’t hold any property from updating instead while doing csv (manual import) remove email mapping from preview stage


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

"{"ADDITIONALTABLES": {"USERS":"SELECT USERNAME,EMAIL FROM USERS"},
"COMPUTEDCOLUMNS":["CUSTOMPROPERTY6"],
"TABLEINDEXES":{"CURRENTUSERS":["USERNAME","EMAIL"]},
"PREPROCESSQUERIES":["UPDATE NEWUSERDATA A JOIN CURRENTUSERS B ON A.USERNAME=B.USERNAME SET A.CUSTOMPROPERTY6 = A.EMAIL WHERE B.CUSTOMPROPERTY6 IS NOT NULL",)]}"

This query is not working, any error?

rushikeshvartak
All-Star
All-Star

Refer https://forums.saviynt.com/t5/saviynt-community-knowledge-base/attribute-precedence-for-user-imports...


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

I am using following code

{"ADDITIONALTABLES":{"USERS":"SELECT USERKEY FROM USERS"},"COMPUTEDCOLUMNS":["email"],"PREPROCESSQUERIES":["UPDATE NEWUSERDATA SET EMAIL = case when NEWUSERDATA.EMAIL is not null and NEWUSERDATA.EMAIL != '' then CURRENTUSERS.EMAIL = CURRENTUSERS.EMAIL) END"]}

, but it is not updating nor creating record.

I want that if Email field is not empty then do nothing with EMAIL field, if Email field is empty then update my EMAIL of CSV file.

Can anyone please correct my code.
  

{
"ADDITIONALTABLES" :
{
"USERS" : "select username,email from users"
},
"COMPUTEDCOLUMNS" :
[
"email"
],
"PREPROCESSQUERIES" :
[
"update NEWUSERDATA nu left join CURRENTUSERS cu on nu.username = cu.username set nu.email = case when nu.EMAIL is not null then nu.email else cu.email end"
]
}


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