and more in a single search tool across platforms. Read the announcement here. |
02/12/2024 09:41 AM
Hi,
Can we do validations on user attributes(endDate) during the user import?
Example:
If endDate of more the 1000 existing users is getting changed during the import, can we validate this condition before updating the endDate 1000 users to: avoid updating the enddate? or stop the import? or ignore stop those 1000 records and update the remaining?
what would be the best practice?
is this possible with preprocessor query? or do we need to have external jar? or any other best options?
Thanks in advance!
Best regards
Harish
02/12/2024 03:41 PM
You can handle this in preprocessor
02/16/2024 04:38 AM
Hi @rushikeshvartak ,
Thanks for the info.
I tried to use the below query to handle this usecase. But getting the below errors in logs. Any suggestion?
"UPDATE NEWUSERDATA INNER JOIN CURRENTUSERS ON NEWUSERDATA.customproperty42 = CURRENTUSERS.customproperty42 SET NEWUSERDATA.customproperty3=(case when COUNT>= 1000 then CURRENTUSERS.customproperty3 else NEWUSERDATA.customproperty3 end) "
COUNT= number of customproperty3 changes - when compared to CURRENTUSERS table and NEWUSERDATA table
Final query after replacing count with inner select:
"UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.customproperty42 = CURRENTUSERS.customproperty42 SET NEWUSERDATA.customproperty3=(case when ((SELECT count(*) FROM CURRENTUSERS INNER JOIN NEWUSERDATA ON CURRENTUSERS.customproperty42 =NEWUSERDATA.customproperty42 where CURRENTUSERS.customproperty3 != NEWUSERDATA.customproperty3)>= 1000) then CURRENTUSERS.customproperty3 else NEWUSERDATA.customproperty3 end) "
is this the way you are suggesting or is there any simple way to build this usecase?
Error from logs: