We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

statusConfig in ImportUserJSON

Murmur
Regular Contributor
Regular Contributor

Hi everyone, 

I would like to use the statusConfig [1] when users are imported. 

I'd like the user status to be dependent on an attribute supplied during the import. Something like: 

{...}
"statusConfig": {
              "active": ${if response.lifecycleStatus == "Employed" return true else return false},
              "inactive": ${if response.lifecycleStatus == "Employed" return false else return true}
            },
{...}

Do you know how I coudl achieve this? 

Besides that, does anyone know what active / inactiv means, and why I need to set them both? 

Cheers 🙂

[1] Developers Handbook (saviyntcloud.com)

8 REPLIES 8

rushikeshvartak
All-Star
All-Star

Use #CONST in mapping and use same in StatusConfig 

rushikeshvartak_0-1702435149940.png

 


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

Rajesh-R
Saviynt Employee
Saviynt Employee

you can directly setup something like this

 

"statuskey": "#CONST${(response.lifecycleStatus=='Employed')?'true':'false'}~#~char"

Status config like below:

"statusConfig": {
              "active": true,
              "inactive": false
            },

Thanks
Rajesh Ramalingam
Saviynt India

Murmur
Regular Contributor
Regular Contributor

Hi @Rajesh-R,

Thanks for your reply.  
While the hint of using both the statuskey AND  statusConfig was really helpful, the logic or JS expression logic does not seem to work. 

I also tried expressions like "statusKey": "#CONST${(1==1)?'true':'false'}~#~char" that do not evaluate to anything. I tried to redirect the output to a customProperty too, but it stays empty.

Murmur_0-1702457400721.png

Do you have a clue, why that could be? 

Besides that, do you know, if I can simply access values from the API call? 

Current ImportUserJSON (simplified):

{ "name":"call1",
    "connection":"acctAuth",
    "url":"<URL>",
    "httpMethod":"POST",
    "httpHeaders":{
       "Authorization":"${access_token}",
       "contentType":"application/json"
    },
    "httpContentType":"application/json",
    "userResponsePath":"employees",
    "colsToPropsMap":{
        "id":"id~#~char",
"statuskey": "#CONST${(1==1)?'true':'false'}~#~char",
"customproperty10": "#CONST${(1==1)?'true':'false'}~#~char",
       "email":"email~#~char"
    },
"statusConfig": { "active": true, "inactive": false },
    "successResponses":{
       "statusCode":[
          200
       ]
    }
 }

 Thanks in advance to everyone 🙂

 

Manu269
All-Star
All-Star

@Murmur you need to put the #CONST key word along with the logic for statuskey

And in statusconfig define the active, inactive status value.

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

Rajesh-R
Saviynt Employee
Saviynt Employee

@Murmur There is a syntax issue: It should be #CONST#

Try the below JSON

 

{ "name":"call1",
    "connection":"acctAuth",
    "url":"<URL>",
    "httpMethod":"POST",
    "httpHeaders":{
       "Authorization":"${access_token}",
       "contentType":"application/json"
    },
    "httpContentType":"application/json",
    "userResponsePath":"employees",
    "colsToPropsMap":{
        "id":"id~#~char",
"statuskey": "#CONST#${(1==1)?'true':'false'}~#~char",
"customproperty10": "#CONST#${(1==1)?'true':'false'}~#~char",
       "email":"email~#~char"
    },
"statusConfig": { "active": true, "inactive": false },
    "successResponses":{
       "statusCode":[
          200
       ]
    }
 }

  


Thanks
Rajesh Ramalingam
Saviynt India

Murmur
Regular Contributor
Regular Contributor

Thant's working 🙂 I already tried that, but it was failing due to the "complex" expression I used. It is working now, with the 1=1 expression.

Maybe one final question. Do you know, how I access return values from the API call (such as id in the colsToPropsMap above)? It seems it fails, when I just enter the field name. 

"statuskey": "#CONST#${(internal.lifecycleStatus =='employed')?'true':'false'}~#~char", 
"customproperty10": "#CONST#${(internal.lifecycleStatus =='employed')?'true':'false'}~#~char", 

returns :
Murmur_0-1702459641704.png

 

API answer: 

"employees": [
            "internal": {
                "lifecycleStatus": "employed"
            },
            "id": "1111111111111111111"
        }
]

 

Rajesh-R
Saviynt Employee
Saviynt Employee

Try the following:

"statuskey": "#CONST#${(response.internal.lifecycleStatus =='employed')?'true':'false'}~#~char", 

 


Thanks
Rajesh Ramalingam
Saviynt India

Murmur
Regular Contributor
Regular Contributor

@Rajesh-R you truly made my day. Thank you!