06/02/2023 01:29 AM
Hi Team,
I am trying to update statuskey while user import so I used MODIFYUSERDATAJSON to do that. But while importing users its getting below error.
Error in Users Import - Error while processing data: Column count doesn't match value count at row 1 |
Below is my Modifyuserdatajson.
{
"ADDITIONALTABLES": {
"USERS": "SELECT STATUSKEY,CUSTOMPROPERTY6 FROM USERS" },
"COMPUTEDCOLUMNS": ["STATUSKEY"],
"PREPROCESSQUERIES": ["UPDATE NEWUSERDATA SET NEWUSERDATA.STATUSKEY = CASE WHEN NEWUSERDATA.CUSTOMPROPERTY6 = '0' THEN '1' ELSE '0' END" ]
}
Thanks,
Gaurav
06/02/2023 04:17 AM - edited 06/02/2023 04:17 AM
Hello @gwagh ,
Can you please try with the below query,
"UPDATE NEWUSERDATA SET STATUSKEY = CASE WHEN CUSTOMPROPERTY6 = 0 THEN 1 ELSE 0 END"
Thanks,
06/02/2023 04:25 AM
Not working still getting same issue. and One more thing i haven't passed any statusthresholdconfig but still it getting trigger while import users. Below is the screenshot for your reference.
Thanks,
Gaurav
06/02/2023 09:25 AM
"USERS": "SELECT CUSTOMPROPERTY6 FROM USERS" },
Can you just add above (removed statuskey from the query) and try ?
06/02/2023 09:37 AM
@dgandhi , No luck still facing same issue.
06/02/2023 10:29 AM
Paste the entire JSON that you are trying.
06/02/2023 10:42 AM
{
"ADDITIONALTABLES": {
"USERS": "SELECT CUSTOMPROPERTY6 FROM USERS" },
"COMPUTEDCOLUMNS": ["STATUSKEY"],
"PREPROCESSQUERIES": ["UPDATE NEWUSERDATA SET STATUSKEY = CASE WHEN CUSTOMPROPERTY6 = 0 THEN 1 ELSE 0 END" ]
}
06/05/2023 05:52 AM
Just cosmetic change, but try this and see if it works
{
"ADDITIONALTABLES": {
"USERS": "SELECT CUSTOMPROPERTY6 FROM USERS"
},
"COMPUTEDCOLUMNS": [
"STATUSKEY"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA SET STATUSKEY = (CASE WHEN CUSTOMPROPERTY6 = 0 THEN 1 ELSE 0 END)"
]
}
06/06/2023 07:30 AM
@dgandhi still not working. I am confused why query showing statusthresholdconfig value in Job history. Please refer the below screenshot of job logs.
06/08/2023 05:44 AM
Have you tried checking the logs to see where the status_threshold config is being taken from?
06/06/2023 02:50 AM
Please ensure that the value 0 in the CASE statement is treated as a string by enclosing it in single quotes '0'. Here's the modified version:
{
"ADDITIONALTABLES": {
"USERS": "SELECT CUSTOMPROPERTY6 FROM USERS"
},
"COMPUTEDCOLUMNS": ["STATUSKEY"],
"PREPROCESSQUERIES": ["UPDATE NEWUSERDATA SET STATUSKEY = CASE WHEN CUSTOMPROPERTY6 = '0' THEN '1' ELSE '0' END"]
}
By enclosing 0 and 1 within single quotes, the values are treated as strings, which may resolve the "Column count doesn't match value count" error.
06/06/2023 07:29 AM
Hi @DixshantValecha , As its string value so I tried with single quotes and without quotes .
06/04/2023 09:29 PM
@gwagh this seems to me like an issue with your USERIMPORT json. Please can you verify the following:
1) Check the column mappings for all the attributes you are pulling from source into Saviynt
2) Especially you need to check the datatype that you are specifying for each column mapping in your import json. For ex: if there are attributes of datatype 'number' or 'Date' on your source application, then the datatype should be specified accordingly for your sourceproperty in the USERIMPORT json.
3) Try to perform an import without anything in the Modifyuserdatajson and check if the import works or not
06/04/2023 11:34 PM
Hi Shiv, USERIMPORT is working fine without Modifyjuserdatajson and all attributes are populating properly.
06/12/2023 12:39 PM
Looks like status threshold config is being picked up from the job trigger. Can you please check and clear it and try again?
06/14/2023 02:13 AM
Here I am confused I haven't configured any status threshold json so from where its taking reference?? Apart from connection do I need to check in other things for statusthresholdjson ??
06/12/2023 02:54 PM
Also while running the keep statuskey in the additionaltables Json
{
"ADDITIONALTABLES": {
"USERS": "SELECT STATUSKEY,CUSTOMPROPERTY6 FROM USERS" },
"COMPUTEDCOLUMNS": ["STATUSKEY"],
"PREPROCESSQUERIES": ["UPDATE NEWUSERDATA SET NEWUSERDATA.STATUSKEY = CASE WHEN NEWUSERDATA.CUSTOMPROPERTY6 = '0' THEN '1' ELSE '0' END" ]
}
06/14/2023 02:12 AM
Tried that as well still same error..
06/14/2023 08:35 AM
Hi @gwagh ,
Can you please share the userimportjson here?