cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jamie2
Helper I
Helper I

Gallery Navigation for nested JSON arrays

Hi,

 

Thanks for taking the time to read my question.

 

I have a JSON with nested arrays and I have created two collections for the arrays highlighted on the screen shot below.

 

I have created a gallery for both collections:

 

PurchaseOrderList  - Gallery1

OrderLines - Gallery2

 

I would like to use a navigation icon on the  Gallery1 to navigate to Gallery2 and filter the 'OrderLines' relevant to the record selected on Gallery1.

 

The problem I have is that there is no common field  or ID between the two arrays, otherwise I would use a lookup to add a column to the OrderLines collection for DocumentNo.

 

I would then add a filter on the gallery 2 items ( filter where OrderLines.DocumentNo= PurchaseOrderList .DocumentNo)

 

The only relationship is that the OrderLines array is nested within the PurchaseOrderList  array.

 

Any help would be greatly appreciated.

 

Jamie2_0-1631880782411.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Jamie2 :

Do you want to get the nested OrderLines array in the selected item in Gallery1 and display it in Gallery2?

If so,just set the Gallery2' items property to:

Gallery1.Selected.OrderLines

Best Regards,

Bof

View solution in original post

6 REPLIES 6
v-bofeng-msft
Community Support
Community Support

Hi @Jamie2 :

Could you please provide some demo JSON in text format of the data source of the two galleries?

Best Regards,

Bof

 

Thanks Bof, here is the JSON.

 

PurchaseOrderList is the first nested array (collection1 / gallery 1) and OrderLines the second nested array (collection2 / gallery 2) 

 

{
"TotalItems": 15,
"CurrentPage": 1,
"PageSize": 15,
"TotalPages": 1,
"PurchaseOrderList": [
{
"Reference": "BGT001",
"ShortName": "BGT Dist",
"Postcode": "DY10 5KK",
"Name": "BGT Distribution Ltd",
"SupplyTo": "",
"DocumentNo": "0000003271",
"DocumentStatus": "Live",
"DocumentDate": "2020-10-08T00:00:00Z",
"RequestedDeliveryDate": "1-01-01T00:00:00Z",
"SupplierDocumentNo": "",
"OrderLines": [
{
"Id": 1396343,
"LineNumber": 1,
"LineType": "Standard",
"Code": "PM/TAP/DUAL/WHITE",
"ItemDescription": "Dual Control Mixer Tap White",
"TaxCode": {
"TaxRateID": 1287,
"Code": 1,
"Name": "Std Rate",
"TaxRate": 20,
"IncludeInTaxReturn": false
},
"LineQuantity": 20,
"InvoiceCreditQuantity": 0,
"UnitDiscountPercent": 0,
"LineTotalValue": 416,
"LineTaxValue": 72.8,
"NominalRef": {
"Reference": "13103",
"CostCentre": "SAL",
"Department": "BES"
},
"AnalysisCode1": "J Franklin",
"AnalysisCode2": "North",
"AnalysisCode3": "",
"AnalysisCode4": "",
"AnalysisCode5": "",
"AnalysisCode6": "",
"AnalysisCode7": "",
"AnalysisCode8": "",
"AnalysisCode9": "",
"AnalysisCode10": "",
"AnalysisCode11": "",
"AnalysisCode12": "",
"AnalysisCode13": "",
"AnalysisCode14": "",
"AnalysisCode15": "",
"AnalysisCode16": "",
"AnalysisCode17": "",
"AnalysisCode18": "",
"AnalysisCode19": "",
"AnalysisCode20": ""
},
{
"Id": 1396345,
"LineNumber": 2,
"LineType": "Standard",
"Code": "PM/SINK/DOUBLE/WHITE",
"ItemDescription": "Double sink unit white enamel",
"TaxCode": {
"TaxRateID": 1287,
"Code": 1,
"Name": "Std Rate",
"TaxRate": 20,
"IncludeInTaxReturn": false
},
"LineQuantity": 10,
"InvoiceCreditQuantity": 0,
"UnitDiscountPercent": 0,
"LineTotalValue": 0,
"LineTaxValue": 0,
"NominalRef": {
"Reference": "13101",
"CostCentre": "SAL",
"Department": "BES"
},
"AnalysisCode1": "J Franklin",
"AnalysisCode2": "North",
"AnalysisCode3": "",
"AnalysisCode4": "",
"AnalysisCode5": "",
"AnalysisCode6": "",
"AnalysisCode7": "",
"AnalysisCode8": "",
"AnalysisCode9": "",
"AnalysisCode10": "",
"AnalysisCode11": "",
"AnalysisCode12": "",
"AnalysisCode13": "",
"AnalysisCode14": "",
"AnalysisCode15": "",
"AnalysisCode16": "",
"AnalysisCode17": "",
"AnalysisCode18": "",
"AnalysisCode19": "",
"AnalysisCode20": ""
}
],
"ExchangeRate": 1,
"CurrencyName": "Pounds Sterling",
"CurrencyISOCode": "GBP",
"SubtotalGoodsValue": 416,
"SubtotalChargesNetValue": 0,
"SubtotalDiscountValue": 0,
"SubtotalLandedCosts": 0,
"TotalNetValue": 416,
"TotalTaxValue": 83.2,
"TotalGrossValue": 499.2,
"OrderInvoiceAddress": {
"AddressLine1": "155 Curzon Court",
"AddressLine2": "Kidderminster",
"AddressLine3": "Worcestershire",
"AddressLine4": "",
"City": "",
"County": "",
"Postcode": "DY10 5KK",
"Country": "Great Britain"
},
"SettlementDiscountDays": 10,
"SettlementDiscPercent": 1.5,
"DocumentDiscountPercentValue": 0,
"DiscountOrSurchargeType": "Discount",
"AnalysisCode1": "J Franklin",
"AnalysisCode2": "North",
"AnalysisCode3": "",
"AnalysisCode4": "",
"AnalysisCode5": "",
"AnalysisCode6": "",
"AnalysisCode7": "",
"AnalysisCode8": "",
"AnalysisCode9": "",
"AnalysisCode10": "",
"AnalysisCode11": "",
"AnalysisCode12": "",
"AnalysisCode13": "",
"AnalysisCode14": "",
"AnalysisCode15": "",
"AnalysisCode16": "",
"AnalysisCode17": "",
"AnalysisCode18": "",
"AnalysisCode19": "",
"AnalysisCode20": "",
"DateTimeUpdated": "2020-07-23T11:48:05Z"
}

v-bofeng-msft
Community Support
Community Support

Hi @Jamie2 :

Sorry, the JSON format of the Demo you provided is incomplete, I cannot test.

In addition, the JSON data you provided is an object but not an array. What is the data source of Gallery1 and Gallery2? Can you make it clear?

Best Regards,

Bof

Hi @v-bofeng-msft 


Apologies, here is the full JSON sample, the data source is a RESTFUL API connecting to ERP software with a SQL database

 

{
"TotalItems": 15,
"CurrentPage": 1,
"PageSize": 15,
"TotalPages": 1,
"PurchaseOrderList": [
{
"Reference": "BGT001",
"ShortName": "BGT Dist",
"Postcode": "DY10 5KK",
"Name": "BGT Distribution Ltd",
"SupplyTo": "",
"DocumentNo": "0000003271",
"DocumentStatus": "Live",
"DocumentDate": "2020-10-08T00:00:00Z",
"RequestedDeliveryDate": "1-01-01T00:00:00Z",
"SupplierDocumentNo": "",
"OrderLines": [
{
"Id": 1396343,
"LineNumber": 1,
"LineType": "Standard",
"Code": "PM/TAP/DUAL/WHITE",
"ItemDescription": "Dual Control Mixer Tap White",
"TaxCode": {
"TaxRateID": 1287,
"Code": 1,
"Name": "Std Rate",
"TaxRate": 20,
"IncludeInTaxReturn": false
},
"LineQuantity": 20,
"InvoiceCreditQuantity": 0,
"UnitDiscountPercent": 0,
"LineTotalValue": 416,
"LineTaxValue": 72.8,
"NominalRef": {
"Reference": "13103",
"CostCentre": "SAL",
"Department": "BES"
},
"AnalysisCode1": "J Franklin",
"AnalysisCode2": "North",
"AnalysisCode3": "",
"AnalysisCode4": "",
"AnalysisCode5": "",
"AnalysisCode6": "",
"AnalysisCode7": "",
"AnalysisCode8": "",
"AnalysisCode9": "",
"AnalysisCode10": "",
"AnalysisCode11": "",
"AnalysisCode12": "",
"AnalysisCode13": "",
"AnalysisCode14": "",
"AnalysisCode15": "",
"AnalysisCode16": "",
"AnalysisCode17": "",
"AnalysisCode18": "",
"AnalysisCode19": "",
"AnalysisCode20": ""
},
{
"Id": 1396345,
"LineNumber": 2,
"LineType": "Standard",
"Code": "PM/SINK/DOUBLE/WHITE",
"ItemDescription": "Double sink unit white enamel",
"TaxCode": {
"TaxRateID": 1287,
"Code": 1,
"Name": "Std Rate",
"TaxRate": 20,
"IncludeInTaxReturn": false
},
"LineQuantity": 10,
"InvoiceCreditQuantity": 0,
"UnitDiscountPercent": 0,
"LineTotalValue": 0,
"LineTaxValue": 0,
"NominalRef": {
"Reference": "13101",
"CostCentre": "SAL",
"Department": "BES"
},
"AnalysisCode1": "J Franklin",
"AnalysisCode2": "North",
"AnalysisCode3": "",
"AnalysisCode4": "",
"AnalysisCode5": "",
"AnalysisCode6": "",
"AnalysisCode7": "",
"AnalysisCode8": "",
"AnalysisCode9": "",
"AnalysisCode10": "",
"AnalysisCode11": "",
"AnalysisCode12": "",
"AnalysisCode13": "",
"AnalysisCode14": "",
"AnalysisCode15": "",
"AnalysisCode16": "",
"AnalysisCode17": "",
"AnalysisCode18": "",
"AnalysisCode19": "",
"AnalysisCode20": ""
}
],
"ExchangeRate": 1,
"CurrencyName": "Pounds Sterling",
"CurrencyISOCode": "GBP",
"SubtotalGoodsValue": 416,
"SubtotalChargesNetValue": 0,
"SubtotalDiscountValue": 0,
"SubtotalLandedCosts": 0,
"TotalNetValue": 416,
"TotalTaxValue": 83.2,
"TotalGrossValue": 499.2,
"OrderInvoiceAddress": {
"AddressLine1": "155 Curzon Court",
"AddressLine2": "Kidderminster",
"AddressLine3": "Worcestershire",
"AddressLine4": "",
"City": "",
"County": "",
"Postcode": "DY10 5KK",
"Country": "Great Britain"
},
"SettlementDiscountDays": 10,
"SettlementDiscPercent": 1.5,
"DocumentDiscountPercentValue": 0,
"DiscountOrSurchargeType": "Discount",
"AnalysisCode1": "J Franklin",
"AnalysisCode2": "North",
"AnalysisCode3": "",
"AnalysisCode4": "",
"AnalysisCode5": "",
"AnalysisCode6": "",
"AnalysisCode7": "",
"AnalysisCode8": "",
"AnalysisCode9": "",
"AnalysisCode10": "",
"AnalysisCode11": "",
"AnalysisCode12": "",
"AnalysisCode13": "",
"AnalysisCode14": "",
"AnalysisCode15": "",
"AnalysisCode16": "",
"AnalysisCode17": "",
"AnalysisCode18": "",
"AnalysisCode19": "",
"AnalysisCode20": "",
"DateTimeUpdated": "2020-07-23T11:48:05Z"
},
{
"Reference": "DIR001",
"ShortName": "Direct",
"Postcode": "CM3 8AS",
"Name": "Direct Tile Importers",
"SupplyTo": "",
"DocumentNo": "0000003272",
"DocumentStatus": "Live",
"DocumentDate": "2020-10-08T00:00:00Z",
"RequestedDeliveryDate": "1-01-01T00:00:00Z",
"SupplierDocumentNo": "",
"OrderLines": [
{
"Id": 1396355,
"LineNumber": 1,
"LineType": "Standard",
"Code": "TILE/WHT/10x10",
"ItemDescription": "Tiles White 10cm x 10cm",
"TaxCode": {
"TaxRateID": 1287,
"Code": 1,
"Name": "Std Rate",
"TaxRate": 20,
"IncludeInTaxReturn": false
},
"LineQuantity": 5,
"InvoiceCreditQuantity": 0,
"UnitDiscountPercent": 0,
"LineTotalValue": 213.84,
"LineTaxValue": 37.42,
"NominalRef": {
"Reference": "13103",
"CostCentre": "SAL",
"Department": "COM"
},
"AnalysisCode1": "J Franklin",
"AnalysisCode2": "North",
"AnalysisCode3": "",
"AnalysisCode4": "",
"AnalysisCode5": "",
"AnalysisCode6": "",
"AnalysisCode7": "",
"AnalysisCode8": "",
"AnalysisCode9": "",
"AnalysisCode10": "",
"AnalysisCode11": "",
"AnalysisCode12": "",
"AnalysisCode13": "",
"AnalysisCode14": "",
"AnalysisCode15": "",
"AnalysisCode16": "",
"AnalysisCode17": "",
"AnalysisCode18": "",
"AnalysisCode19": "",
"AnalysisCode20": ""
},
{
"Id": 1396357,
"LineNumber": 2,
"LineType": "Standard",
"Code": "TILE/WHT/20X20",
"ItemDescription": "Tiles White 20cm x 20cm",
"TaxCode": {
"TaxRateID": 1287,
"Code": 1,
"Name": "Std Rate",
"TaxRate": 20,
"IncludeInTaxReturn": false
},
"LineQuantity": 6,
"InvoiceCreditQuantity": 0,
"UnitDiscountPercent": 0,
"LineTotalValue": 42.96,
"LineTaxValue": 7.52,
"NominalRef": {
"Reference": "13103",
"CostCentre": "SAL",
"Department": "COM"
},
"AnalysisCode1": "J Franklin",
"AnalysisCode2": "North",
"AnalysisCode3": "",
"AnalysisCode4": "",
"AnalysisCode5": "",
"AnalysisCode6": "",
"AnalysisCode7": "",
"AnalysisCode8": "",
"AnalysisCode9": "",
"AnalysisCode10": "",
"AnalysisCode11": "",
"AnalysisCode12": "",
"AnalysisCode13": "",
"AnalysisCode14": "",
"AnalysisCode15": "",
"AnalysisCode16": "",
"AnalysisCode17": "",
"AnalysisCode18": "",
"AnalysisCode19": "",
"AnalysisCode20": ""
},
{
"Id": 1396359,
"LineNumber": 3,
"LineType": "Standard",
"Code": "TILE/WHT/20X20",
"ItemDescription": "Tiles White 20cm x 20cm",
"TaxCode": {
"TaxRateID": 1287,
"Code": 1,
"Name": "Std Rate",
"TaxRate": 20,
"IncludeInTaxReturn": false
},
"LineQuantity": 16,
"InvoiceCreditQuantity": 0,
"UnitDiscountPercent": 0,
"LineTotalValue": 114.56,
"LineTaxValue": 20.05,
"NominalRef": {
"Reference": "13103",
"CostCentre": "SAL",
"Department": "COM"
},
"AnalysisCode1": "J Franklin",
"AnalysisCode2": "North",
"AnalysisCode3": "",
"AnalysisCode4": "",
"AnalysisCode5": "",
"AnalysisCode6": "",
"AnalysisCode7": "",
"AnalysisCode8": "",
"AnalysisCode9": "",
"AnalysisCode10": "",
"AnalysisCode11": "",
"AnalysisCode12": "",
"AnalysisCode13": "",
"AnalysisCode14": "",
"AnalysisCode15": "",
"AnalysisCode16": "",
"AnalysisCode17": "",
"AnalysisCode18": "",
"AnalysisCode19": "",
"AnalysisCode20": ""
}
],
"ExchangeRate": 1,
"CurrencyName": "Pounds Sterling",
"CurrencyISOCode": "GBP",
"SubtotalGoodsValue": 371.36,
"SubtotalChargesNetValue": 0,
"SubtotalDiscountValue": 0,
"SubtotalLandedCosts": 0,
"TotalNetValue": 371.36,
"TotalTaxValue": 74.27,
"TotalGrossValue": 445.63,
"OrderInvoiceAddress": {
"AddressLine1": "Unit 3 EDT Business Court",
"AddressLine2": "Upper Rainham Road",
"AddressLine3": "South Woodham Ferrers",
"AddressLine4": "Chelmsford Essex",
"City": "",
"County": "",
"Postcode": "CM3 8AS",
"Country": "Great Britain"
},
"SettlementDiscountDays": 0,
"SettlementDiscPercent": 0,
"DocumentDiscountPercentValue": 0,
"DiscountOrSurchargeType": "Discount",
"AnalysisCode1": "J Franklin",
"AnalysisCode2": "North",
"AnalysisCode3": "",
"AnalysisCode4": "",
"AnalysisCode5": "",
"AnalysisCode6": "",
"AnalysisCode7": "",
"AnalysisCode8": "",
"AnalysisCode9": "",
"AnalysisCode10": "",
"AnalysisCode11": "",
"AnalysisCode12": "",
"AnalysisCode13": "",
"AnalysisCode14": "",
"AnalysisCode15": "",
"AnalysisCode16": "",
"AnalysisCode17": "",
"AnalysisCode18": "",
"AnalysisCode19": "",
"AnalysisCode20": "",
"DateTimeUpdated": "2020-07-23T11:48:05Z"
}
]
}

v-bofeng-msft
Community Support
Community Support

Hi @Jamie2 :

Do you want to get the nested OrderLines array in the selected item in Gallery1 and display it in Gallery2?

If so,just set the Gallery2' items property to:

Gallery1.Selected.OrderLines

Best Regards,

Bof

View solution in original post

I had been looking at solutions using filters and lookups. Thanks to you I now understand now that the fact that the collections are nested is all that is required in order to use the selected function. I'm new to Power Apps and I really appreciate all your assistance  👍 😃

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (945)