and more in a single search tool across platforms. Read the announcement here. |
12/11/2022 12:34 AM
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 ??
Solved! Go to Solution.
12/11/2022 08:18 AM
You can’t hold any property from updating instead while doing csv (manual import) remove email mapping from preview stage
12/11/2022 08:25 AM
"{"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?
12/12/2022 04:17 AM
12/14/2022 08:53 AM
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.
12/14/2022 09:37 AM
{
"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"
]
}