I need to Extract multiple key value from json response based on condition.
Below is json response I get in HTTP Request. I need to extract value of ID based on value of Document_ID value.
I am using $..result[?(#.Document_ID==${documentID})].ID to extract value.
But I need to use this multiple times. As there is list of DocumentIDs for which I need to Get respective List of IDs from the same response.
"result": [
{
"Owner": "PaperSave System",
"Company": "RENXT Support Test Environment 1",
"Document_ID": 46136,
"Type of Gift": "Donation",
"ContentType": "TIFF",
"Acknowledgement Date": null,
"IsRunning": true,
"FileName": "test.tif",
"Gift Amount": 10.0,
"DepositCheck": null,
"HasEventRaiseRights": true,
"Step": "Deposit_Issues",
"PaperSaveWorkflow_ID": 30,
"Submit for Deposit": "Yes",
"Created": "2022-02-09T14:11:24.6",
"CurrentUserName": "PaperSave System",
"Deposit Date": "2021-10-14T00:00:00",
"Bank Account Number": "0063130611",
"Number": null,
"Batch": "",
"Check Date": "2021-10-12T00:00:00",
"Lookup": null,
"ID": 25370,
"Check Number": 1220.0,
"Payment Method": "Direct Debit",
"RDSCanBeVoided": null,
"Constituent": "AAA Concretee",
"Status": "",
"Post Status": "Posted",
"Successful Deposit Submission": "Yes",
"Acknowledgement Status": null,
"Receipt Date": "2021-11-05T00:00:00",
"Receipt Status": "Receipted",
"Receipt Amount": 10.0,
"Gift Splits": "131043",
"Post Date": "2021-10-12T00:00:00",
"Has been associated field": "ps_database_ps",
"Gift Processor": "PaperSave System",
"Is Anonymous": "Yes",
"Routing Number": "122000496",
"Soft Credit": null,
"Gift Date": "2021-10-12T00:00:00",
"ContentId": 11474,
"Deposit Status": null,
"IsTerminated": null,
"FileSize": 8,
"Location": null
},
{
"Owner": "PaperSave System",
"Company": "RENXT Support Test Environment 1",
"Document_ID": 46137,
"Type of Gift": "Donation",
"ContentType": "TIFF",
"Acknowledgement Date": null,
"IsRunning": true,
"FileName": "test.tif",
"Gift Amount": 10.0,
"DepositCheck": null,
"HasEventRaiseRights": true,
"Step": "Deposit_Issues",
"PaperSaveWorkflow_ID": 30,
"Submit for Deposit": "Yes",
"Created": "2022-02-09T14:11:47.43",
"CurrentUserName": "PaperSave System",
"Deposit Date": "2021-10-14T00:00:00",
"Bank Account Number": "0063130611",
"Number": null,
"Batch": "",
"Check Date": "2021-10-12T00:00:00",
"Lookup": null,
"ID": 25371,
"Check Number": 1220.0,
"Payment Method": "Direct Debit",
"RDSCanBeVoided": null,
"Constituent": "AAA Concretee",
"Status": "",
"Post Status": "Posted",
"Successful Deposit Submission": "Yes",
"Acknowledgement Status": null,
"Receipt Date": "2021-11-05T00:00:00",
"Receipt Status": "Receipted",
"Receipt Amount": 10.0,
"Gift Splits": "131065",
"Post Date": "2021-10-12T00:00:00",
"Has been associated field": "ps_database_ps",
"Gift Processor": "PaperSave System",
"Is Anonymous": "Yes",
"Routing Number": "122000496",
"Soft Credit": null,
"Gift Date": "2021-10-12T00:00:00",
"ContentId": 11475,
"Deposit Status": null,
"IsTerminated": null,
"FileSize": 8,
"Location": null
}
Is there any way I can achieve this?
Related
I am new to Nifi, i hv a requirement where we get multiple JSON inputs with different Header Names. I have to parse the JSON and insert into different tables based on the Header value.
Not sure how to use RouteonContent processor or EvaluateJSON Path processor
Input 1
{
"Location": [
{
"country": "US",
"division": "Central",
"region": "Big South",
"locationID": 1015,
"location_name": "Hattiesburg, MS (XF)",
"location_type": "RETAIL",
"location_sub_type": "COS",
"store_type": "",
"planned_open_date": "",
"planned_close_date": "",
"actual_open_date": "2017-07-26",
"actual_close_date": "",
"new_store_flag": "",
"address1": "2100 Lincoln Road",
"address2": "",
"city": "Hattiesburg",
"state": "MS",
"zip": 39402,
"include_for_planning": "Y"
},
{
"country": "US",
"division": "Central",
"region": "Big South",
"locationID": 1028,
"location_name": "Laurel, MS",
"location_type": "RETAIL",
"location_sub_type": "COS",
"store_type": "",
"planned_open_date": "",
"planned_close_date": "",
"actual_open_date": "",
"actual_close_date": "",
"new_store_flag": "",
"address1": "1225 5th street",
"address2": "",
"city": "Laurel",
"state": "MS",
"zip": 39440,
"include_for_planning": "Y"
}
]
Input 2
{
"Item": [
{
"npi_code": "NEW",
"cifa_category": "XM",
"o9_category": "Accessories"
},
{
"npi_code": "NEW",
"cifa_category": "XM0",
"o9_category": "Accessories"
}
]
Use the website https://jsonpath.com/ to figure out the proper JSON expression. But what you could potentially do is use: if the array contains either $.npi_code then do X and if it contains $. country, then do Y
In API Platform 2.7 the response body contained fields that had a null value, after upgrading to API Platform 3 the response body does not contain fields that have a null value. Is this deliberate or due to a configuration change I need to make.
I executed the same call from the api/docs page for 2.7 and 3.0 I expected the results to be the same.
API Platform 2.7 response for class Patient
{
"#context": "/api/contexts/Patient",
"#id": "/api/patients/8110",
"#type": "Patient",
"account": "/api/accounts/8110",
"accountId": 8110,
"isDependent": false,
"isGuardian": false,
"organization": "/api/organizations/765",
"email": null,
"title": null,
"firstName": "CA",
"middleInitial": "A",
"lastName": "Patient",
"suffix": null,
"photoMedia": null,
"sex": "male",
"birthDate": "2000-01-01T00:00:00+00:00",
"addressLineOne": "5759 Witting Corners",
"addressLineTwo": null,
"city": "Marvintown",
"zipCode": "35507",
"state": {
"#id": "/api/states/681",
"#type": "State",
"abbreviation": "CA"
},
"phoneNumber": "617-491-0000",
"mobileNumber": null,
"workNumber": null
}
API Platform 3.0 response for class Patient
{
"#context": "/api/contexts/Patient",
"#id": "/api/patients/8110",
"#type": "Patient",
"account": "/api/accounts/8110",
"accountId": 8110,
"isDependent": false,
"isGuardian": false,
"organization": "/api/organizations/765",
"firstName": "CA",
"middleInitial": "A",
"lastName": "Patient",
"sex": "male",
"birthDate": "2000-01-01T00:00:00+00:00",
"addressLineOne": "5759 Witting Corners",
"city": "Marvintown",
"zipCode": "35507",
"state": {
"#id": "/api/states/681",
"#type": "State",
"abbreviation": "CA"
},
"phoneNumber": "617-491-0000",
}
Relates to this question
You only need to set skip_null_values to false in your normalization_context, because starting 3.0.0 beta 1 they decided it would become true by default.
If you need it to be false for all resources, you can set the default in your config/packages/api_platform.yaml:
api_platform:
...
defaults:
normalization_context:
skip_null_values: false
I'm testing how Metaplex's Candy Machine works and I'm having the tittle error while uploading using the CMv2-cli.
My config file is the following:
{
"price": 0,
"number": 10,
"gatekeeper": null,
"solTreasuryAccount": "<8TBP4QrwkbDEmmYbA1EJum7HN8S2c1QYvEgTPdfb35Lh>",
"splTokenAccount": null,
"splToken": null,
"goLiveDate": "27 May 2022 09:20:00 UTC",
"endSettings": null,
"whitelistMintSettings": null,
"hiddenSettings": null,
"storage": "arweave-sol",
"ipfsInfuraProjectId": null,
"ipfsInfuraSecret": null,
"nftStorageKey": null,
"awsS3Bucket": null,
"noRetainAuthority": false,
"noMutable": false
}
One of my assets file is the following:
{
"name": "Test #0001",
"symbol": "NB",
"description": "Collection of 10 numbers on the Solana blockchain.",
"seller_fee_basis_points": 500,
"image": "0.png",
"attributes": [
{"trait_type": "Layer-1", "value": "0"},
{"trait_type": "Layer-2", "value": "0"},
{"trait_type": "Layer-3", "value": "0"},
{"trait_type": "Layer-4", "value": "1"}
],
"properties": {
"creators": [{"address": "8TBP4QrwkbDEmmYbA1EJum7HN8S2c1QYvEgTPdfb35Lh ", "share": 100}],
"files": [{"uri": "0.png", "type": "image/png"}]
},
"collection": {"name": "numbers", "family": "numbers"}
}
You have 2 big errors in both files (config and the metadata).
For the config file you should not use the < > symbols, so your config file should look like this:
{
"price": 0,
"number": 10,
"gatekeeper": null,
"solTreasuryAccount": "8TBP4QrwkbDEmmYbA1EJum7HN8S2c1QYvEgTPdfb35Lh",
"splTokenAccount": null,
"splToken": null,
"goLiveDate": "27 May 2022 09:20:00 UTC",
"endSettings": null,
"whitelistMintSettings": null,
"hiddenSettings": null,
"storage": "arweave-sol",
"ipfsInfuraProjectId": null,
"ipfsInfuraSecret": null,
"nftStorageKey": null,
"awsS3Bucket": null,
"noRetainAuthority": false,
"noMutable": false
}
For the asset file you have an extra space at the end of the creators array, so you should remove that extra space from this file and I assume from the rest of ur assets too. Should look like this:
{
"name": "Test #0001",
"symbol": "NB",
"description": "Collection of 10 numbers on the Solana blockchain.",
"seller_fee_basis_points": 500,
"image": "0.png",
"attributes": [
{"trait_type": "Layer-1", "value": "0"},
{"trait_type": "Layer-2", "value": "0"},
{"trait_type": "Layer-3", "value": "0"},
{"trait_type": "Layer-4", "value": "1"}
],
"properties": {
"creators": [{"address": "8TBP4QrwkbDEmmYbA1EJum7HN8S2c1QYvEgTPdfb35Lh", "share": 100}],
"files": [{"uri": "0.png", "type": "image/png"}]
},
"collection": {"name": "numbers", "family": "numbers"}
}
We are building an API to expose our account data for entities using ODATA REST API.
One of our downstream system wants to consume our API wants to filter data for all Internal Accounts only.
The Query used is $Filter=accounts/all(account: account/Type eq 'Internal')
They get all the Entities with accounts that have 'Internal' but few missing entities. One such missing entity in output payload is "EntityId": 140630.
The only difference between this entity '140630' and other entities that make up to the payload is that, has accounts that belong to both types 'Internal and External'.
But the expectation is that downstream wants all entities that have accounts with type 'Internal' invariably whether the entity has only Internal accounts or both (Internal and External).
Based on our initial analysis, ODATA 'All' filter considers entities that have only Account/Type that has 'Internal' and skips entities with accounts that have both 'Internal' and 'External'.
With 'Any' Filter, entities that have account type 'Internal' + entities that have account type 'Internal' and 'External' are fetched. In this case we see the payload having Entity 140630 with accounts both Internal and External. But as per requirement, the downstream system should not be exposed with 'External' accounts.
Need support to write a fitting ODATA Filter that brings Entities that contains internal accounts. Whether they have only internal accounts or have both internal and External accounts.
From the sample payload provided below
the filtered output should bring entities
"EntityId": 140278, and accounts (Only have internal accounts)
"EntityId": 440365, and accounts (Only have internal accounts)
"EntityId": 140630, and accounts "Id": 228643,"Id": 228647, (Only internal accounts from the list of accounts they have)
Any directions to achieve the above requirement will be much appreciated.
The json payload with out any filter looks like
{
"#odata.context": "https://abc.myteamtest.webdomain.com/TAcctService/API/$metadata#TAccount(Accounts(CIS(),accountRel()))",
"value": [
{
"EntityId": 140278,
"Accounts": [
{
"Id": 229016,
"Type": "Internal",
"TradingSourceSystem": "ABC",
"TradingCode": "18951",
"ShortName": "MyBank ABC 124543",
"FullName": "MyBank ABC (OU 124543)",
"TradingBusiness": "ASL",
"Status": "Active",
"accrualCode": "ACC",
"CreatedDt": "2017-11-18T04:29:31.552+05:30",
"UpdatedDt": "2022-01-31T13:06:12.053+05:30",
"UpdatedBy": "admin",
"EntityRole": "CUSTR",
"CIS": {
"TradingCodeAttributesID": 229016,
"id": "69776",
"description": "MyBank HOLDINGS INC.",
"CorpCode": "NY001",
"TradingLocation": "YORK SITE",
"OrgunitId": "124543",
"OrgunitDescription": "ABC - FUNDING",
"BusinessUnit": "OTHER",
"Location": "USA",
"ProfitCenter": "124543",
"CustomerGroup": "07956",
"CISLegalEntityId": "07956",
"CISLegalEntityName": "MyBank HOLDINGS INC."
},
"accountRel": {
"TradingCodeAttributesID": 229016,
"RelatedEntityId": null,
"Relationshiptype": null,
"Restrictedpartyname": null,
"Confidentialityagreementind": null
}
}
]
},
{
"EntityId": 440365,
"Accounts": [
{
"Id": 228919,
"Type": "Internal",
"TradingSourceSystem": "ABC",
"TradingCode": "21700",
"ShortName": "MyBank 69002",
"FullName": "MyBank Limited (69002)",
"TradingBusiness": "ASL",
"Status": "Active",
"accrualCode": "MTM",
"CreatedDt": "2017-11-18T04:29:33.228+05:30",
"UpdatedDt": "2022-01-31T13:06:12.053+05:30",
"UpdatedBy": "admin",
"EntityRole": "CUSTR",
"CIS": {
"TradingCodeAttributesID": 228919,
"id": "69002",
"description": "MyBank LIMITED",
"CorpCode": "WGINT",
"TradingLocation": "UnKnown",
"OrgunitId": "69002",
"OrgunitDescription": "MyBank LIMITED",
"BusinessUnit": "MANAGED",
"Location": "WES",
"ProfitCenter": "69002",
"CustomerGroup": "69002",
"CISLegalEntityId": "69002",
"CISLegalEntityName": "MyBank LIMITED"
},
"accountRel": {
"TradingCodeAttributesID": 228919,
"RelatedEntityId": null,
"Relationshiptype": null,
"Restrictedpartyname": null,
"Confidentialityagreementind": null
}
}
]
},
{
"EntityId": 140630,
"Accounts": [
{
"Id": 219926,
"Type": "External",
"TradingSourceSystem": "MSS",
"TradingCode": "MARINE",
"ShortName": null,
"FullName": "My Bank of Testing",
"TradingBusiness": null,
"Status": "Active",
"accrualCode": null,
"CreatedDt": "2021-01-26T19:24:03.327+05:30",
"UpdatedDt": "2021-01-26T19:19:21+05:30",
"UpdatedBy": null,
"EntityRole": "CUSTR",
"CIS": {
"TradingCodeAttributesID": 0,
"Boaid": null,
"Boadescription": null,
"CorpCode": null,
"TradingLocation": null,
"OrgunitId": null,
"OrgunitDescription": null,
"BusinessUnit": null,
"Location": null,
"ProfitCenter": null,
"CustomerGroup": null,
"CISLegalEntityId": null,
"CISLegalEntityName": null
},
"accountRel": {
"TradingCodeAttributesID": 0,
"RelatedEntityId": null,
"Relationshiptype": null,
"Restrictedpartyname": null,
"Confidentialityagreementind": null
}
},
{
"Id": 219927,
"Type": "External",
"TradingSourceSystem": "MSS",
"TradingCode": "PRESET",
"ShortName": null,
"FullName": "My Bank of Testing",
"TradingBusiness": null,
"Status": "Active",
"accrualCode": null,
"CreatedDt": "2021-02-23T15:50:46.013+05:30",
"UpdatedDt": "2021-02-23T15:50:45+05:30",
"UpdatedBy": null,
"EntityRole": "CUSTR",
"CIS": {
"TradingCodeAttributesID": 0,
"Boaid": null,
"Boadescription": null,
"CorpCode": null,
"TradingLocation": null,
"OrgunitId": null,
"OrgunitDescription": null,
"BusinessUnit": null,
"Location": null,
"ProfitCenter": null,
"CustomerGroup": null,
"CISLegalEntityId": null,
"CISLegalEntityName": null
},
"accountRel": {
"TradingCodeAttributesID": 0,
"RelatedEntityId": null,
"Relationshiptype": null,
"Restrictedpartyname": null,
"Confidentialityagreementind": null
}
},
{
"Id": 228643,
"Type": "Internal",
"TradingSourceSystem": "ABC",
"TradingCode": "24633",
"ShortName": "AB124 94189",
"FullName": "AB124 CRT",
"TradingBusiness": "MSL",
"Status": "Active",
"accrualCode": null,
"CreatedDt": "2017-11-18T04:29:34.409+05:30",
"UpdatedDt": "2022-01-31T13:06:12.053+05:30",
"UpdatedBy": null,
"EntityRole": "CUSTR",
"CIS": {
"TradingCodeAttributesID": 0,
"Boaid": "09902",
"Boadescription": "OFFICE",
"CorpCode": "ABCC1",
"TradingLocation": "York",
"OrgunitId": "94189",
"OrgunitDescription": "MAP",
"BusinessUnit": "CIO",
"Location": "PAN",
"ProfitCenter": "94189",
"CustomerGroup": "09902",
"CISLegalEntityId": "29997",
"CISLegalEntityName": "My PARENT BANK"
},
"accountRel": {
"TradingCodeAttributesID": 0,
"RelatedEntityId": null,
"Relationshiptype": null,
"Restrictedpartyname": null,
"Confidentialityagreementind": null
}
},
{
"Id": 228647,
"Type": "Internal",
"TradingSourceSystem": "ABC",
"TradingCode": "7574",
"ShortName": "ABC1234 COLL13122",
"FullName": "ABC1234 Collateral Pool",
"TradingBusiness": "MSL",
"Status": "Active",
"accrualCode": null,
"CreatedDt": "2017-11-18T04:29:35.234+05:30",
"UpdatedDt": "2022-01-31T13:06:12.053+05:30",
"UpdatedBy": null,
"EntityRole": "CUSTR",
"CIS": {
"TradingCodeAttributesID": 0,
"Boaid": "09602",
"Boadescription": "P&T",
"CorpCode": "ABC12342",
"TradingLocation": "YORK",
"OrgunitId": "13122",
"OrgunitDescription": "FIC",
"BusinessUnit": "MARKETS",
"Location": "PAN",
"ProfitCenter": "13122",
"CustomerGroup": "09602",
"CISLegalEntityId": "29997",
"CISLegalEntityName": "ABC1234 PARENT BANK"
},
"accountRel": {
"TradingCodeAttributesID": 0,
"RelatedEntityId": null,
"Relationshiptype": null,
"Restrictedpartyname": null,
"Confidentialityagreementind": null
}
}
]
}
]
}
I'm assuming that you're using EntityFramework in this scenario. If so, I suggest you try this:
public IQueryable<Entity> Get()
{
return _databaseContext.Entities
.Include(entity => entity.Accounts.Where(account => account.Type = "Internal"))
.AsNoTracking();
}```
I use create event api to create an event object with "onlineMeetingUrl: https://meet.lync.com/example/joyce/NLSD7Y62" but the response of "onlineMeetingUrl" is null.
Is it a bug or is there any way to create a new event with 'onlineMeetingUrl'?
Here are my test steps.
Step 1. POST /me/events
{
"#odata.etag": "W/\"BfXylo4WykyAenTZICXL5AAApUQ11g==\"",
"id": "AAMkADVmMzE2MjY0LTZkOGYtNGI4MS1iNWMxLTljYzg3MWY5MWQxMQBGAAAAAABZMfR36TVMQ6yunaqZPvVRBwAF9fKWjhbKTIB6dNkgJcvkAAAAAAENAAAF9fKWjhbKTIB6dNkgJcvkAAClFy2jAAA=",
"createdDateTime": "2018-03-07T02:31:20.6459109Z",
"lastModifiedDateTime": "2018-03-07T02:31:24.2554747Z",
"changeKey": "BfXylo4WykyAenTZICXL5AAApUQ11g==",
"categories": [],
"originalStartTimeZone": "Taipei Standard Time",
"originalEndTimeZone": "Taipei Standard Time",
"iCalUId": "040000008200E00074C5B7101A82E00800000000E5DACD60BCB5D301000000000000000010000000A65419D96CF4C347B8B3B5A340753291",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "Sky Meeting",
"bodyPreview": "Join online meeting",
"importance": "normal",
"sensitivity": "normal",
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkADVmMzE2MjY0LTZkOGYtNGI4MS1iNWMxLTljYzg3MWY5MWQxMQBGAAAAAABZMfR36TVMQ6yunaqZPvVRBwAF9fKWjhbKTIB6dNkgJcvkAAAAAAENAAAF9fKWjhbKTIB6dNkgJcvkAAClFy2jAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl": "https://meet.lync.com/example/joyce/NLSD7Y62",
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "Join online meeting"
},
"start": {
"dateTime": "2018-03-08T00:00:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-03-08T00:30:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "Online meeting"
},
"recurrence": null,
"attendees": [],
"organizer": {
"emailAddress": {
"name": "Joyce",
"address": "joyce#example.com"
}
}
}
Step 2. The onlineMeetingUrl in the response event object is null.
{
...
"onlineMeetingUrl": null,
...
}
The onlineMeetingUrl property is not writable. We will update the documentation to reflect this.
Add these params in the request body
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
onlineMeetingUrl is null in response even while passing "isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"