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.

LPAD into importUserJson

Jillustre
New Contributor III
New Contributor III

Hi. Is it possible to add zero left padding for a value received into the importUserJson? Right now the field receive 13 but need to be saved as 013.

thanks

9 REPLIES 9

rushikeshvartak
All-Star
All-Star

Which connector ? its possible in rest

 

https://forums.saviynt.com/t5/identity-governance/rest-string-functions/m-p/23721/emcs_t/S2h8ZW1haWx...


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

Yeah, this is for rest. didn't find any syntax on your link for left pad on your link. And also what is the language? sql?

Jillustre
New Contributor III
New Contributor III

@rushikeshvartak Ive tried  "COSTCENTER":"#CONST#${String data1 = LPAD(Job.CostCenter,3,0); return data1 }~#~char"

but in the Cost center field it add the whole value {String data1 = LPAD(Job.CostCenter,3,0); return data1 }

 "COSTCENTER": "#CONST#${String data1 ='0'; String data2 = response.<variable path to cost center>; res = data1 + data2; return res }~#~char"

Thy this 


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

Jillustre
New Contributor III
New Contributor III

@sk not working
I have this

Jillustre_0-1675960911385.png

then after the import, 

Jillustre_1-1675960940404.png

 

Can you please share sample response API response and also full importJSON you can  mask the client specific information


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

Jillustre
New Contributor III
New Contributor III

@sk Sorry, I copy paste without changing the placeholder you add. Will tried again with what @rushikeshvartak put.

but I'm not sure it will work. From what I understood, both syntax add 0 at the front of the value. I really need a Left padding. because cometime the value is 111, or 13, or 1, so 13 need to be 013 and 1, 001.

"COSTCENTER": "#CONST#${String data1 ='0'; String data2 = response.Job.CostCenter; ret = data1 + \" \" + data2; return res }~#~char"


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

Same thing, the result is imported into CostCenter field 

Jillustre_0-1675964260323.png

@rushikeshvartak @sk