Export of Entity and its child on the basis of relationship attribute value.
AnsweredBelow is the scenario which need to handle for client:-
We need to export a Parent Entity (GZACP) along with its associated Child Entities (VZACP) based on certain conditions. Specifically:
- Suppose GZACP entity has 100 associated VZACP child records.
- Out of these 100 VZACP records, 30 of them contain one or more 'empty' values in mandatory attributes. For these records, the relationship attribute "completeforsfcc" is set to false.
- The remaining 70 VZACP records, where all conditions are met (i.e., no empty mandatory attributes), will have the "completeforsfcc" attribute set to true.
- Only the GZACP entity and the 70 VZACP records with a true relationship attribute ("completeforsfcc") will be included in the export.
- The 30 VZACP records with the false relationship attribute will be excluded from the export.
Can you please let us know how this can be handled? The relationship is defined from VZACP to GZCAP.
I have created a profile to handle this but this is providing all VZACP and exclusion is not working. I am attaching the export and its output for reference. It has 1 GZACP and 3 VZACP. 2 has relationship attribute as "True" and 1 has relationship attribute as false.
-
Hi Rahul,
There is an Article on Doc Where we filter assets with isprimary true and export only those:
https://docx.syndigo.com/docs/create-export-profile-to-export-entities-with-assets
The sample provided here is under "assetsCriterion" Block , but same you can try similar way in your profile directly in collect block and try.
{
"filter": {
"include": {
"GZACP": {
"queryFields": {
"relationships": [
"<<your relationship shortname >>"
],
"queryFilters": {
"relationshipAttributesCriterion": {
"<<your relationship shortname >>": [
{
"completeforsfcc": {
"exact": "true"
}
}
]
}
}
}
}
}
}
}PS: Somehow there is no profile or output file attached with your comment
1 -
{
"configObjects": [
{
"id": "override_halfords_gzacp_export_data_blob_task_base_withattribute",
"name": "override_halfords_gzacp_export_data_blob_task_base_withattribute",
"type": "integrationprofile",
"properties": {
"createdService": "configurationManageService",
"createdBy": "rahul.aggarwal@wundermanthompson.com_user",
"modifiedService": "configurationManageService",
"modifiedBy": "rahul.aggarwal@wundermanthompson.com_user",
"createdDate": "2024-10-03T10:41:14.966+0100",
"modifiedDate": "2024-10-03T10:41:14.966+0100"
},
"data": {
"contexts": [
{
"context": {
"app": "RSConnect",
"channel": "AZURE_BLOB_GZACP",
"format": "JSON",
"order": "619",
"role": "admin",
"service": "ENTITY_EXPORT",
"source": "internal",
"subtype": "System",
"user": "system"
},
"jsonData": {
"transform": {
"settings": {
"allowNullValues": "true",
"matchEnhancerAttributes": true,
"clearMissingAttributes": "false",
"strategies": [
{
"caseFormat": "NONE",
"trimTrailingNumbers": "false",
"isDefault": "false",
"removeSpecialCharacters": "false",
"removeWhitespace": "false",
"useExternalName": "false",
"trimLeadingNumbers": "false"
}
],
"entityType": "@field(type)",
"enableDynamicMapping": true,
"nullRecordTransformer": "false"
}
},
"integrationType": "System",
"isEnabled": "true",
"isMergeableWithCustom": true,
"publish": {
"filter": {
"include": {},
"exclude": {}
},
"isBinaryStreamPersistent": "true",
"channel": [
{
"settings": {
"folderPath": "Entity/ZACP/GZACP",
"storageAccountName": "syndigodev",
"containerName": "halfords-export",
"additionalSettings": {
"prefixTimeStamp": "true"
}
},
"type": "azureBlobConnector"
}
],
"format": {
"settings": {
"additionalSettings": {
"includeEntityProperties": false,
"dateTimeFormat": "yyyy-MM-dd'T'HH:mm:ss",
"encoding": "utf8",
"fileNameFormat": "Entity/ZACP/GZACP/SFCC_GZACP_{{DATETIME}}.json"
}
},
"type": "RSJSON",
"batchSize": 10000,
"version": "1.1"
}
},
"collect": {
"filter": {
"include": {
"useProfileAttributesOnly": true,
"typesCriterion": {
"gzacp": {
"queryFields": {
"relatedEntitiesSettings": {
"ischildof": {
"includeWhereUsed": true,
"includeWhereUsedEntityTypes": [
"vzacp"
],
"recursive": false
}
},
"attributes": [
"articletype",
"characteristic3name",
"characteristic4name",
"definingcharacteristicname1",
"definingcharacteristicname2",
"hacnumber",
"images",
"pacename",
"pimidentifier",
"primarycategory",
"sfccprimecatiduk",
"tyrerecom",
"vehicletype",
"weblongdescription",
"webname",
"webshortdescription",
"characteristic5name",
"thghalfordscom"
],
"relationships": [
"_ALL"
],
"relatedEntitiesRelationships": [
"ischildof"
],
"queryFilters": {
"relationshipAttributesCriterion": {
"ischildof": [
{
"completeforsfcc": {
"exact": "true"
}
}
]
}
}
}
},
"vzacp": {
"queryFields": {
"relationships": [
"_ALL"
],
"attributes": [
"hacnumber",
"tyrepattern",
"definingcharacteristicvalue1",
"definingcharacteristicvalue2",
"characteristic3value",
"characteristic4value",
"characteristic5value"
],
"relToAttributes": [
"completeforsfcc"
]
}
}
}
},
"exclude": {
"typesCriterion": {
"vzacp": {
"queryFields": {
"relationships": [
"ischildof"
]
},
"queryFilters": {
"ischildof": {
"relationshipAttributesCriterion": [
{
"completeforsfcc": {
"exact": "false"
}
}
]
}
}
}
}
}
},
"isBinaryStreamPersistent": "false",
"channel": [
{
"type": "rdpConnector",
"settings": {
"includeMatchingAttributes": false,
"includeEnhancerAttributes": true,
"includeRelatedEntities": true,
"includeRelatedEntitiesRecursive": false,
"version": "1.1",
"includeRelatedEntityExternalIds": true
}
}
],
"format": {
"settings": {
"additionalSettings": {
"encoding": "utf8"
}
},
"type": "RSJSON",
"batchSize": 50,
"version": "1.1"
}
}
}
}
]
}
}
]
}0 -
{
"entities": [
{
"data": {
"attributes": {
"articletype": {},
"characteristic5value": {},
"pimidentifier": {},
"characteristic4name": {},
"characteristic4value": {},
"webname": {},
"definingcharacteristicname1": {},
"pacename": {},
"definingcharacteristicname2": {},
"weblongdescription": {},
"thghalfordscom": {
"values": [
{
"id": "2_0_0",
"value": "Halfords.com-Taxonomy>>WNS>>Halfords.com>>Tyres>>Tyre Brands>>Sailun",
"locale": "en-GB",
"os": "businessRule",
"osid": "tocomputehalfordscomclassificationwhenchangeinidentifier_businessRule",
"ostype": "businessRule",
"source": "internal",
"properties": {
"referenceDataIdentifier": "502382",
"refIdPath": "halfordscomroot>>WNS>>0321WNS>>500078>>500227>>502382",
"referenceData": "classification/502382"
}
}
]
},
"hacnumber": {
"values": [
{
"id": "1_0_0",
"value": "4381834",
"locale": "en-GB",
"source": "internal"
}
]
},
"characteristic3value": {},
"characteristic5name": {},
"characteristic3name": {},
"tyrepattern": {
"values": [
{
"id": "1_0_0",
"value": "sv28",
"locale": "en-GB",
"source": "internal"
}
]
},
"primarycategory": {},
"definingcharacteristicvalue1": {},
"definingcharacteristicvalue2": {},
"webshortdescription": {}
}
},
"properties": {
"createdService": "entityManageService",
"createdBy": "rahul.aggarwal@wundermanthompson.com_user",
"createdDate": "2023-10-06T04:55:54.555+0100",
"recordId": "6b47f2d6-de28-422d-83ce-a86d3684d4cb",
"rowNo": 26641,
"originatingUser": "rahul.aggarwal@wundermanthompson.com_user",
"modifiedService": "entityManageService",
"modifiedBy": "rahul.aggarwal@wundermanthompson.com_user",
"modifiedDate": "2024-12-06T10:29:59.778+0000",
"thumbnailid": "https://i1.adis.ws/i/washford/sv28"
},
"type": "vzacp",
"id": "98ca2492-2360-4cd0-b6fe-f4e28bf595a0",
"name": "1646753631937"
},
{
"data": {
"attributes": {
"articletype": {
"values": [
{
"id": "1_0_0",
"value": "GZACP",
"locale": "en-GB",
"source": "internal"
}
]
},
"pimidentifier": {
"values": [
{
"id": "1_0_0",
"value": "1646753525321",
"locale": "en-GB",
"invalidValue": "1646753525321",
"source": "internal"
}
]
},
"characteristic4name": {
"values": [
{
"id": "2_0_0",
"value": "SpeedRating",
"locale": "en-GB",
"os": "defaults",
"osid": "gzacp_entityDefaultValuesModel",
"ostype": "entityDefaultValuesModel",
"source": "internal"
}
]
},
"webname": {
"values": [
{
"id": "1_0_0",
"value": "SV28",
"locale": "en-GB",
"source": "internal"
}
]
},
"definingcharacteristicname1": {
"values": [
{
"id": "2_0_0",
"value": "SectionWidth",
"locale": "en-GB",
"os": "defaults",
"osid": "gzacp_entityDefaultValuesModel",
"ostype": "entityDefaultValuesModel",
"source": "internal"
}
]
},
"pacename": {},
"definingcharacteristicname2": {
"values": [
{
"id": "2_0_0",
"value": "AspectRatio",
"locale": "en-GB",
"os": "defaults",
"osid": "gzacp_entityDefaultValuesModel",
"ostype": "entityDefaultValuesModel",
"source": "internal"
}
]
},
"weblongdescription": {
"values": [
{
"id": "1_0_0",
"value": "<ul><li>This is a value summer tyre designed for SUV's and 4x4s</li></ul>",
"locale": "en-GB",
"source": "internal"
}
]
},
"thghalfordscom": {
"values": [
{
"id": "2_0_0",
"value": "Halfords.com-Taxonomy>>WNS>>Halfords.com>>Tyres>>Tyre Brands>>Sailun",
"locale": "en-GB",
"os": "businessRule",
"osid": "tocomputehalfordscomclassificationwhenchangeinidentifier_businessRule",
"ostype": "businessRule",
"source": "internal",
"properties": {
"referenceDataIdentifier": "502382",
"refIdPath": "halfordscomroot>>WNS>>0321WNS>>500078>>500227>>502382",
"referenceData": "classification/502382"
}
}
]
},
"hacnumber": {
"values": [
{
"id": "1_0_0",
"value": "sv28",
"locale": "en-GB",
"source": "internal"
}
]
},
"sfccprimecatiduk": {
"values": [
{
"id": "1_0_0",
"value": 502382,
"locale": "en-GB",
"source": "internal"
}
]
},
"characteristic5name": {
"values": [
{
"id": "2_0_0",
"value": "LoadRating",
"locale": "en-GB",
"os": "defaults",
"osid": "gzacp_entityDefaultValuesModel",
"ostype": "entityDefaultValuesModel",
"source": "internal"
}
]
},
"characteristic3name": {
"values": [
{
"id": "2_0_0",
"value": "RimDiameter",
"locale": "en-GB",
"os": "defaults",
"osid": "gzacp_entityDefaultValuesModel",
"ostype": "entityDefaultValuesModel",
"source": "internal"
}
]
},
"primarycategory": {},
"webshortdescription": {
"values": [
{
"id": "1_0_0",
"value": "<ul><li>This is a value summer tyre designed for SUV's and 4x4s</li></ul>",
"locale": "en-GB",
"source": "internal"
}
]
}
}
},
"properties": {
"createdService": "entityManageService",
"createdBy": "rahul.aggarwal@wundermanthompson.com_user",
"createdDate": "2023-09-20T10:35:38.325+0100",
"thumbnailid": "https://i1.adis.ws/i/washford/sv28",
"originatingUser": "halfordsds.systemadmin@syndigo.com_user",
"recordId": "70bf9df4-f009-4e9c-8f13-dfcf9d3df8dc",
"rowNo": 975,
"modifiedService": "entityManageService",
"modifiedBy": "halfordsds.systemadmin@syndigo.com_user",
"modifiedDate": "2024-10-16T10:27:22.462+0100"
},
"type": "gzacp",
"id": "b5e463ba-0221-4fc1-8153-eab7fc32d258",
"name": "1646753525321"
},
{
"data": {
"attributes": {
"articletype": {},
"characteristic5value": {},
"pimidentifier": {},
"characteristic4name": {},
"characteristic4value": {},
"webname": {},
"definingcharacteristicname1": {},
"pacename": {},
"definingcharacteristicname2": {},
"weblongdescription": {},
"thghalfordscom": {
"values": [
{
"id": "2_0_0",
"value": "Halfords.com-Taxonomy>>WNS>>Halfords.com>>Tyres>>Tyre Brands>>Sailun",
"locale": "en-GB",
"os": "businessRule",
"osid": "tocomputehalfordscomclassificationwhenchangeinidentifier_businessRule",
"ostype": "businessRule",
"source": "internal",
"properties": {
"referenceDataIdentifier": "502382",
"refIdPath": "halfordscomroot>>WNS>>0321WNS>>500078>>500227>>502382",
"referenceData": "classification/502382"
}
}
]
},
"hacnumber": {
"values": [
{
"id": "1_0_0",
"value": "4381831",
"locale": "en-GB",
"source": "internal"
}
]
},
"characteristic3value": {},
"characteristic5name": {},
"characteristic3name": {},
"tyrepattern": {
"values": [
{
"id": "1_0_0",
"value": "sv28",
"locale": "en-GB",
"source": "internal"
}
]
},
"primarycategory": {},
"definingcharacteristicvalue1": {},
"definingcharacteristicvalue2": {},
"webshortdescription": {}
},
"relationships": {
"ischildof": [
{
"id": "3_0_0",
"relTo": {
"id": "b5e463ba-0221-4fc1-8153-eab7fc32d258",
"type": "gzacp",
"data": {
"attributes": {
"pimidentifier": {
"values": [
{
"id": "1_0_0",
"value": "1646753525321",
"locale": "en-GB",
"invalidValue": "1646753525321",
"source": "internal"
}
]
}
}
}
},
"os": "graph",
"attributes": {
"completeforsfcc": {
"values": [
{
"id": "7_0_0",
"value": true,
"locale": "en-GB",
"source": "internal"
}
]
}
}
}
]
}
},
"properties": {
"createdService": "entityManageService",
"createdBy": "rahul.aggarwal@wundermanthompson.com_user",
"createdDate": "2023-10-06T04:52:09.630+0100",
"recordId": "220ca533-82a4-4533-ae55-3e54b7164091",
"rowNo": 11627,
"originatingUser": "rahul.aggarwal@wundermanthompson.com_user",
"modifiedService": "entityManageService",
"modifiedBy": "rahul.aggarwal@wundermanthompson.com_user",
"modifiedDate": "2024-12-06T10:30:07.460+0000",
"thumbnailid": "https://i1.adis.ws/i/washford/sv28"
},
"type": "vzacp",
"id": "80f6ebe1-ed39-43ac-810b-1de923a4e88d",
"name": "1646753631934"
},
{
"data": {
"attributes": {
"articletype": {},
"characteristic5value": {},
"pimidentifier": {},
"characteristic4name": {},
"characteristic4value": {},
"webname": {},
"definingcharacteristicname1": {},
"pacename": {},
"definingcharacteristicname2": {},
"weblongdescription": {},
"thghalfordscom": {
"values": [
{
"id": "2_0_0",
"value": "Halfords.com-Taxonomy>>WNS>>Halfords.com>>Tyres>>Tyre Brands>>Sailun",
"locale": "en-GB",
"os": "businessRule",
"osid": "tocomputehalfordscomclassificationwhenchangeinidentifier_businessRule",
"ostype": "businessRule",
"source": "internal",
"properties": {
"referenceDataIdentifier": "502382",
"refIdPath": "halfordscomroot>>WNS>>0321WNS>>500078>>500227>>502382",
"referenceData": "classification/502382"
}
}
]
},
"hacnumber": {
"values": [
{
"id": "1_0_0",
"value": "4381846",
"locale": "en-GB",
"source": "internal"
}
]
},
"characteristic3value": {},
"characteristic5name": {},
"characteristic3name": {},
"tyrepattern": {
"values": [
{
"id": "1_0_0",
"value": "sv28",
"locale": "en-GB",
"source": "internal"
}
]
},
"primarycategory": {},
"definingcharacteristicvalue1": {},
"definingcharacteristicvalue2": {},
"webshortdescription": {}
},
"relationships": {
"ischildof": [
{
"id": "3_0_0",
"relTo": {
"id": "b5e463ba-0221-4fc1-8153-eab7fc32d258",
"type": "gzacp",
"data": {
"attributes": {
"pimidentifier": {
"values": [
{
"id": "1_0_0",
"value": "1646753525321",
"locale": "en-GB",
"invalidValue": "1646753525321",
"source": "internal"
}
]
}
}
}
},
"os": "graph",
"attributes": {
"completeforsfcc": {
"values": [
{
"id": "7_0_0",
"value": true,
"locale": "en-GB",
"source": "internal"
}
]
}
}
}
]
}
},
"properties": {
"createdService": "entityManageService",
"createdBy": "rahul.aggarwal@wundermanthompson.com_user",
"createdDate": "2023-10-06T04:58:23.083+0100",
"recordId": "90fce690-bba6-47b4-8ca9-92079fd58ab4",
"rowNo": 36416,
"originatingUser": "rahul.aggarwal@wundermanthompson.com_user",
"modifiedService": "entityManageService",
"modifiedBy": "rahul.aggarwal@wundermanthompson.com_user",
"modifiedDate": "2024-12-06T10:29:24.408+0000",
"thumbnailid": "https://i1.adis.ws/i/washford/sv28"
},
"type": "vzacp",
"id": "32915351-5488-441a-af95-9f29b27b0342",
"name": "1646753631949"
}
]
}0 -
Hi Team,
Attached the profile which I have created for this use case and output file.In Output file, we are geeting 3 VZACP records 1 GZACP record. From these 3 records, only 2 are having "completeforsfcc" as true and 1 record is having this relationship attribute as false.
In output file, partial filtering is working and 2 VZACP records are having relatinship as expected but 1 record which is not fulfilling the criteria should be filter out.
Please have a look at this part and share the outcome. Also, I have open the ticket 170, which you can verify for profile and output file.
Thanks,0 -
Hi Rahul,
The output file data you copied above is having two entities entry with completeforsfcc attribute value as true , somehow i am not seeing third one, am i missing anything ?
Unfortunately I do not have access to the ticket 170 raised by you so can not see your attached file.
There is one article on doc for using filter in profile , can you please try following that , it should work for you https://docx.syndigo.com/v2/docs/en/create-export-profile-for-filter-criteria?highlight=relationshipAttributesCriterion
Hope this helps!
0
Please sign in to leave a comment.
Comments
5 comments