=concat($.selector,'-',#attribute,...)
Return a concatenated selector’s value
i.e: 'value_of_selector-value_of_attribute'
|
{"order_status": "Eligible", "id": 12321}
candidate_journey_status = "Offer: Offer In-Progress"
=concat($.order_status, '_', #candidate_journey_status)
Eligible_Offer: Offer In-Progress
|
=join_non_empty('|','item1', '', 'item2',...)
Note: same concat but have delimiter and only join non-empty values
Return a concatenated selector’s value
i.e: 'item1|item2'
|
{"empty": "", "id": "ITEM1"}
item2 = "ITEM2"
=join_non_empty('|', $.empty, '$.id', #item2)
ITEM1|ITEM2
|
=findwhere(
'$.selector_string',
'$.selector_find_where_string',
'comparison_operator',
'find_where_val_string_1',find_where_val_string_2, …
)
Note: available comparison_operators: == , in Return a string of selector
i.e: '$.selector_string[1]
|
{
"candidate": {
"asessements": [
{"status": "IN_PROGRESS", "details": {"id": "a1"}},
{"status": "COMPLETE", "details": {"id": "a2"}},
{"status": "COMPLETE", "details": {"id": "a3"}}
]
}
}
=findwhere('$.candidate.asessements', '$.status', '==', 'COMPLETE')
$.candidate.asessements[1]
|
=selector('$.selector_string','.sub_selector_string')
Return the selector’s value from string of selector
i.e: 'value_of_selector_string_sub_selector_string'
|
{
"candidate": {
"asessements": [
{"status": "IN_PROGRESS", "details": {"id": "a1"}},
{"status": "COMPLETE", "details": {"id": "a2"}},
{"status": "COMPLETE", "details": {"id": "a3"}}
]
}
}
=selector(
=findwhere('$.candidate.asessements', '$.status', '==', 'COMPLETE'),
'.details.id'
)
a2
|
=get_wd_app_id_by_reqid($selector,#__job_req_id)
Note: wd:Candidate_Job_Application_Data should not be nested in the payload, if it's nested, replace $ with $.selector to expose it Return value of job_app_text based on job_req_id
i.e: 'value_of_job_app_text_based_on_reqid'
|
{
"wd:Candidate_Job_Application_Data": [
{
"wd:Job_Application_Reference": {
"wd:ID": [
{
"@wd:type": "WID",
"#text": "d38aa495327d90012124cc14af260002"
},
{
"@wd:type": "Job_Application_ID",
"#text": "JOB_APPLICATION-3-832589"
}
]
},
"wd:Job_Requisition_Reference": {
"wd:ID": [
{
"@wd:type": "WID",
"#text": "0bd642e6a9bc0102143ce66dee120000"
},
{
"@wd:type": "Job_Requisition_ID",
"#text": "REQ22-42894"
}
]
}
},
{
"wd:Job_Application_Reference": {
"wd:ID": [
{
"@wd:type": "WID",
"#text": "d38aa495327d900121870175128c0002"
},
{
"@wd:type": "Job_Application_ID",
"#text": "JOB_APPLICATION-3-832590"
}
]
},
"wd:Job_Requisition_Reference": {
"wd:ID": [
{
"@wd:type": "WID",
"#text": "707931d70a010100dac3453f10780000"
},
{
"@wd:type": "Job_Requisition_ID",
"#text": "REQ22-42651"
}
]
}
}
]
}
__job_req_id = "REQ22-42894"
=get_wd_app_id_by_reqid($, #__job_req_id)
JOB_APPLICATION-3-832589
|
=mapvalue($.selector,map_name, #default_value)
Return output value of $.selector after mapping i.e: 'value_of_selector_after_mapping'
|
{"data": {"object": {"language": "us"}}}
default_lang = "es"
=mapvalue($.data.object.language, 'map_name', #default_lang)
- Result (returns default_value if present)
es
|
=split($.selector,char_to_split_on,order_to_pick)
Return a value at order_to_pick index of the split list
i.e: value_2nd_of_the_list
|
{
"data": {
"object": {
"language": "english$lang"
}
}
}
=split($.data.object.language, '$', '0')
english
|
=in($.selector,value_1,value_2,value_n,...)
Return ‘TRUE’ if selector’s value in the list [value_1,value_2,value_n,...] else return '' Note: why '' instead of ‘FALSE’? ‘FALSE’ is not a null string → can’t be used in if condition i.e: ''
|
{"ProgressStatus": "InProgress"}
=in($.ProgressStatus, "InProgress", "Completed")
TRUE
|
=and(value_1,value_2,...,value_n)
Return last value if all values in the list are not null string else return '' i.e: 'value_n'
|
{"ProgressStatus": "InProgress"}
__journey_candidate_status = "I-9: Sent to Candidate"
=and(
=in($.ProgressStatus, "InProgress"),
=in(#__journey_candidate_status, "I-9: Sent to Candidate")
)
TRUE
|
=or('',value_1,value_2,...,value_n)
Return first non-null value else return '' i.e: 'value_1'
|
{"ProgressStatus": "Pending"}
__journey_candidate_status = "I-9: Sent to Candidate"
=or(
=in($.ProgressStatus, "InProgress"),
=in(#__journey_candidate_status, "I-9: Sent to Candidate")
)
TRUE
|
=if($.selector, $.selector_true, $.selector_false)
Return selector_true’s value if $.selector’s value is not null else return selector_false’s value i.e: 'value_selector_true'
|
{"ProgressStatus": "Pending"}
=if(
=in($.ProgressStatus, "InProgress", "Completed"),
$.ProgressStatus,
"default"
)
default
|
=includes($.selector, 'or', 'a', 'b', 'c',... 'n')
Note: logical_operators: and , or Return ‘TRUE’ if selector’s value includes the 'sub_string' else return '' i.e: 'TRUE'
|
{"selector_1": "Some text with astrazeneca"}
attr_1 = "with"
=includes($.selector_1, 'and', 'astrazeneca', #attr_1)
TRUE
|
=jmespath('query_expression')
Query payloads with the JMESPath language modified for candidate attributes support
Notes:
-
jmespath function executes a query at the root of a payload (do not use $ to start a jmespath selector)
-
jmespath function can only work with request/response payloads and does not support headers
-
jmespath function can only be mixed with other existing/legacy functions when it returns a string
- Since
# is used for candidate attributes, in rare cases where a key contains #, we have to escape it with ## (and quote the key as well per the JMESPath documentation). Shown in example 2
- Similar to the above bullet point, if dealing with a response (like from workday) and the field name is
wd:something. You will need to quote the key as well due to the : symbol.
- If using a comparison function like
== or != in the expression, you will need to escape the single quotes around the string, since the single quote is the correct jmespath expression, but the single quote is reserved for invoking our =jmespath('') function. You can see this in the first example.
|
Example 1
{
"d": {
"results": [
{"candidateId": "4444", "status": "ACCEPTED"},
{"candidateId": "5555", "status": "REJECTED"},
{"candidateId": "6666", "status": "ACCEPTED"}
]
}
}
=jmespath('d.results[?status==\'ACCEPTED\'].candidateId')
['4444', '6666']
Example 2
{
"store#A": {
"book": [
{"category": "reference", "title": "Book1", "price": 8.95},
{"category": "fiction", "title": "Book2", "price": 12.99}
]
}
}
price = "12"
=jmespath('"store##A".book[?price<`#price`].category | [0]')
reference
Example 3
{
"d": {
"results": [
{
"candidateId": "4444",
"jobsApplied": {
"results": [
{"applicationId": "2000"}
]
}
}
]
}
}
=concat( =jmespath('d.results[0].candidateId'), '-', =jmespath('d.results[0].jobsApplied.results[0].applicationId') )
4444-2000
|
|
=jwt_lifetime($.access_token)
Return expired_in in seconds.
Some Auth APIs don't provide the lifetime when we retrieve a JWT token, so this function helps calculate expired_in based on the access_token value."
|
{"access_token": "abcdef"}
=jwt_lifetime($.access_token)
3600
|
|
=jmespath('parse_json(query_expression).json_path')
Vendors sometimes send us stringified JSON and we need a function to be able to process pull values out of that json.
|
{
"EventID": 17258,
"EventType": 303,
"EventGuid": "768e9e3e-f2a6-4c4a-a66e-dfcc44c5d3d6",
"PayloadAsJSON": "{\"WBS\":\"EI9\",\"Version\":\"2023.0\",\"ResponsibleParty\":\"Employer\",\"Priority\":\"High\",\"TaskType\":\"ElectronicI9\",\"TaskStatus\":\"PendingOtherTask\",\"EmployeeGuid\":\"60524926-C925-4CA2-8A43-A9E886D78746\",\"EmployeeClientID\":\"gAAAAABm6f9R1r-jLSWl0i7mdL7sTqZdO3I1yJwmy0kpzr_26jN2zP8fU5H6qztqJ0t_WH1yyiAgCbXcg9wK-l_Xp0t7Ccl_iA\",\"TaskDefinitionGuid\":\"390D4A25-0310-411D-9351-739572C4601F\",\"CustomerGuid\":\"A0902246-8AFA-43A7-8A19-2A3ADDCA8258\",\"AssignedOn\":null,\"DueDate\":\"2024-09-20T22:14:42.397\",\"CreatedOn\":\"2024-09-17T22:14:42.523\",\"LastModifiedOn\":\"2024-09-17T22:14:42.447\",\"GuidID\":\"5799E58D-82CB-4A88-B334-CADB633ED87D\",\"Name\":\"Electronic I-9\"}",
"PublishedOn": "2024-09-17T22:22:13.273",
"WebhookGuid": "236ddfe7-4908-43c9-8bde-ed957a59ad85",
"CustomerGuid": "a0902246-8afa-43a7-8a19-2a3addca8258"
}
=jmespath('parse_json(PayloadAsJSON).EmployeeClientID')
gAAAAABm6f9R1r-jLSWl0i7mdL7sTqZdO3I1yJwmy0kpzr_26jN2zP8fU5H6qztqJ0t_WH1yyiAgCbXcg9wK-l_Xp0t7Ccl_iA
|
=jmespath('content_to_url(`#__long_id`,`example_file_name`, @)') |
BASE64stringAZaz09+/==
=jmespath('content_to_url(`#__long_id`,`example_file_name`, @)')
- Result
The resume file will be created and stored using the same logic as the candidates/{OID}/documents API
https://test.paradox.ai/document/user/bc9d400a5e7741f5861d3
|