Forum Discussion
This didn’t worked for me
Failure: Map type does not have a method named: map, found in: …]: date[1]} ))). Perhaps you meant: mapKeys, mapValues, Resolution: Please check expression syntax and data types.
It didn’t because the first and second data source that you posted are completely different.
I updated my expression ( the only issue is that with the previous source, the data was on the root level, but on the new source, the data is within the “data” object ), please refer to the expression below:
{}.extend(...$data.entries().map(val => {[val[0]]: val[1].map(v => {}.extend(...v.entries().map(date => date[0].contains("_DATE") && date[1] == null ? {[date[0]]: "0000-00-00"} : {[date[0]]: date[1]} )))}))
Here is the result:
[
{
"data":{
"TIMEDEPENDENTDATA":[
{
"ASSET":"000050",
"SUBNUMBER":"0000",
"FROM_DATE":"1900-01-01",
"TO_DATE":"9999-12-31",
"W_DATE":"0000-00-00",
"X_DATE":"0000-00-00"
}
],
"SELECTIONCRITERIA":[
{
"PARAMETER":"GENERALDATA",
"FIELD":"ASSET",
"SIGN":"I",
"OPTION":"E",
"LOW":"00005000",
"HIGH":""
}
],
"REALESTATE":[
],
"POSTINGINFORMATION":[
{
"ASSET":"0000502",
"SUBNUMBER":"0000",
"C_DATE":"2006-08-31",
"DEACT_DATE":"0000-00-00",
"PLRET_DATE":"0000-00-00",
"PO_DATE":"0000-00-00",
"CAP_KEY":""
}
],
"NETWORTHVAL":[
],
"INVENTORY":[
{
"ASSET":"000050",
"SUBNUMBER":"0000",
"V_DATE":"0000-00-00",
"W_DATE":"0000-00-00"
}
],
"INSURANCE":[
]
}
}
]
- aditya_gupta414 years agoContributor
Hi,
This still shows error:
Also, the $data is an object and inside that there are multiple arrays.
- j_angelevski4 years agoContributor III
I think the data that you are sharing and the data that you are working with are completely different. I suggest you to share the actual data that you are working with and if there is some sensitive information just replace it with “X” or something else, because what we need is the actual format of the data.
- aditya_gupta414 years agoContributor
Here is the json file. This is the actual output format.
mapping_SAP output output0.zip (1.6 KB)
- tharunm4 years agoNew Contributor II
a new error
{“response_map”: {“error_list”: [{“message”: "Request to login.microsoftonline.com failed authentication: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret is provided.\r\nTrace ID: b2e03ecc-49a0-4023-a68c-f20007d5c100\r\nCorrelation ID: 2ef4b658-77fa-48d2-ad3c-9c8596c8a08d\r\nTimestamp: 2021-09-14 14:35:52Z","error_codes":[7000215],"timestamp":"2021-09-14 14:35:52Z","trace_id":"b2e03ecc-49a0-4023-a68c-f20007d5c100","correlation_id":"2ef4b658-77fa-48d2-ad3c-9c8596c8a08d","error_uri":"https://login.microsoftonline.com/error?code=7000215\“}”}]}, “http_status_code”: 500}