NetTalk Central

Author Topic: SOLVED: Web Service Method - parallel nested tables  (Read 3913 times)

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
SOLVED: Web Service Method - parallel nested tables
« on: November 29, 2023, 03:28:21 AM »
If you (me) take the time to read the documentation, it says quite precisely how to solve the challenge. It's all about using queues. I also took the time to understand the code that the template generates and it all makes a lot of sense.
Now it's working like a dream!
Sorry for wasting your time.

Regards Niels


Quote
Hi

I have built a view with a join in a join and it works really well. Both the result and the documentation are exactly as I would like it to be.
But how do I get another file (Orders)  into the same level as (Invoices) one of the existing ones.
Two joins in a view in the same level in clarion of course don't work, so how do I add another array to my result - and so the documentation comes with it.


Code: [Select]
Customer --> Region --> Invoices
                    --> Orders 

NT 14.13

Regards Niels

« Last Edit: December 05, 2023, 06:35:01 AM by Niels Larsen »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Web Service Method - parallel nested tables
« Reply #1 on: November 29, 2023, 07:58:57 AM »
>> two joins in a view in the same level in clarion of course don't work,

um, sure they do.

Perhaps post your actual view code?

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Web Service Method - parallel nested tables
« Reply #2 on: November 30, 2023, 12:13:01 AM »
For each customer there is 3 Regions. For each Region there is 4 Orders and 4 Invoices.
The orders are displayed correctly - 4 per Region, but the invoices are displayed 4 times the number of Regions, 16 times (the same 4 invoices are displayed 4 times).
I have attached a test app. On the Web Server window I have placed a button for generating test data. There are 10 customers from 1 - 10.

Code: [Select]
CustomerView              VIEW(Customer)
                          Project(CUS:GUID)
                          Project(CUS:Number)
                          Project(CUS:Name)
                                JOIN(REG:Customer_KEY,CUS:GUID)
                                    JOIN(ORD:Region_KEY,REG:GUID)
                                    END
                                    JOIN(INV:Region_KEY,REG:GUID)
                                    END
                                END
                          END


Code: [Select]

{
"databaseCustomer_response" : {
"customer" : [
{
"guid" : "6F6TMD0K-I55I-Z7WI-Z3Q4-YR8TTZUXP2IU",
"number" : 1,
"name" : "HO8W6UC3ATNOVPRKVQ4L",
"region" : [
{
"guid" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"customer" : "6F6TMD0K-I55I-Z7WI-Z3Q4-YR8TTZUXP2IU",
"name" : "K8Q6FF1XUPOMADMUH487",
"orders" : [
{
"number" : 1,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "MGZKGGW2U42TUJG7DB9NJ4ZS8AQ3OV9Q95A3SZ4CA2WZQABSBEA2IL627MC1QDWOWMFJR88N4DN34AO0ZU5FBCCFJM81822NOZCJ"
},
{
"number" : 2,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "WBYT3UXFM8W4VGZ9BOG90WDSU1BFYZQ1EEETFBWA5IDI4MWQETGTFTRN7UXERYTEVW7VABVJKR7B1W9ZYNUUG6KIZ0ISBPVESUF5"
},
{
"number" : 3,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "DIP39T5ZRNP7BNM1R8RZEJSX63YDIQ6QDMENOZ6ZNIRG4R2QLGUNUNTLLTZE7UNG0XOH93T7BXJJ3XGH69UMFQVJ4TTVYRACB6P5"
},
{
"number" : 4,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "CPWKCT7YS96MFAXSI4GUYCWWX0LDRU8J775I6U1PQPHG9VHCE0FEN9VLML7CHJP7HDLD9IRC0YZ2PNH84OAT1HQ468T9T16S7X5T"
}
],
"invoices" : [
{
"number" : 1,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "2MJ4MTEYS218HXN82GVRA88KA3DUAIY5X1RUNX6R1OHN0JZ31RVRP5HX9AL66TU9TF7UNWXNZ44JNVRXUD5Y6HPOKWR72SEE5BH9"
},
{
"number" : 2,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "OCCG3QEDTGCNC7NVL45PA8TEARHXXKNIEPR77UBRSBJROPI6KNLSYJMW8JPSNY62Q5OTDU3HEISKO2IWPQ4FP3EY5EDIPVCR7J9Y"
},
{
"number" : 3,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "VAEY2TMVY7SWETVNDJ472PKTFVDU2BO9QF6BUN02YFSU6SS80XURB24UIJU3DRDIVXEYHDX31JJJQ4NZ3MEV654Q0T7AUVPR6T37"
},
{
"number" : 4,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "0EDHIYVOYZOY9D053QXCTPJE3160J7WWS45JD9DTQK5U4MBQGGFWU0TMW74J1MRHFQTL74YJWVHF91P7N3MKY0DR1DUOYZHRYQT9"
},
{
"number" : 1,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "2MJ4MTEYS218HXN82GVRA88KA3DUAIY5X1RUNX6R1OHN0JZ31RVRP5HX9AL66TU9TF7UNWXNZ44JNVRXUD5Y6HPOKWR72SEE5BH9"
},
{
"number" : 2,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "OCCG3QEDTGCNC7NVL45PA8TEARHXXKNIEPR77UBRSBJROPI6KNLSYJMW8JPSNY62Q5OTDU3HEISKO2IWPQ4FP3EY5EDIPVCR7J9Y"
},
{
"number" : 3,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "VAEY2TMVY7SWETVNDJ472PKTFVDU2BO9QF6BUN02YFSU6SS80XURB24UIJU3DRDIVXEYHDX31JJJQ4NZ3MEV654Q0T7AUVPR6T37"
},
{
"number" : 4,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "0EDHIYVOYZOY9D053QXCTPJE3160J7WWS45JD9DTQK5U4MBQGGFWU0TMW74J1MRHFQTL74YJWVHF91P7N3MKY0DR1DUOYZHRYQT9"
},
{
"number" : 1,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "2MJ4MTEYS218HXN82GVRA88KA3DUAIY5X1RUNX6R1OHN0JZ31RVRP5HX9AL66TU9TF7UNWXNZ44JNVRXUD5Y6HPOKWR72SEE5BH9"
},
{
"number" : 2,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "OCCG3QEDTGCNC7NVL45PA8TEARHXXKNIEPR77UBRSBJROPI6KNLSYJMW8JPSNY62Q5OTDU3HEISKO2IWPQ4FP3EY5EDIPVCR7J9Y"
},
{
"number" : 3,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "VAEY2TMVY7SWETVNDJ472PKTFVDU2BO9QF6BUN02YFSU6SS80XURB24UIJU3DRDIVXEYHDX31JJJQ4NZ3MEV654Q0T7AUVPR6T37"
},
{
"number" : 4,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "0EDHIYVOYZOY9D053QXCTPJE3160J7WWS45JD9DTQK5U4MBQGGFWU0TMW74J1MRHFQTL74YJWVHF91P7N3MKY0DR1DUOYZHRYQT9"
},
{
"number" : 1,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "2MJ4MTEYS218HXN82GVRA88KA3DUAIY5X1RUNX6R1OHN0JZ31RVRP5HX9AL66TU9TF7UNWXNZ44JNVRXUD5Y6HPOKWR72SEE5BH9"
},
{
"number" : 2,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "OCCG3QEDTGCNC7NVL45PA8TEARHXXKNIEPR77UBRSBJROPI6KNLSYJMW8JPSNY62Q5OTDU3HEISKO2IWPQ4FP3EY5EDIPVCR7J9Y"
},
{
"number" : 3,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "VAEY2TMVY7SWETVNDJ472PKTFVDU2BO9QF6BUN02YFSU6SS80XURB24UIJU3DRDIVXEYHDX31JJJQ4NZ3MEV654Q0T7AUVPR6T37"
},
{
"number" : 4,
"region" : "UY1YK6IG-PZBE-CAVL-5BKA-3WC91IXV6PBI",
"text" : "0EDHIYVOYZOY9D053QXCTPJE3160J7WWS45JD9DTQK5U4MBQGGFWU0TMW74J1MRHFQTL74YJWVHF91P7N3MKY0DR1DUOYZHRYQT9"
}
]
},
{
"guid" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"customer" : "6F6TMD0K-I55I-Z7WI-Z3Q4-YR8TTZUXP2IU",
"name" : "RJDN03XFHLIEGPN76QWQ",
"orders" : [
{
"number" : 5,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "JD9DH9ZT1AS36676E31BPCKFR1I164KA9EKC71KW7IYISCGD66FXMQ0JCDNJ6QVF7SREO9CHRPG4OSXS3LE700VE32TB7JQ6ZDGM"
},
{
"number" : 6,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "QY0OZITB8IW8YFUZN4VV9UK0HSZX6ONPI5ET9BJP5PRO15DXQ8VE9UZX6NKAHUKFD3HC6H22KTGDTWHWOC76NZZN07037Q9XR2M4"
},
{
"number" : 7,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "GRWCMPB5ZGEB5HS2J06SK9GSNBOEXNEGLF0HZEO70HJI9R9PV23NHZ0MU1ULE7BW6DK5G9TQLYLPGXIRV7Y8JBHZBVRUCFQGK7LO"
},
{
"number" : 8,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "PWPCN03701LJUFUQ9G44N9GMO75F33IDN1UWRVSZ2FT50ISOLN3PS6WS9GW19OHPLQUH528FRHXURC0YYBTU2OK2C28YICXZOSKK"
}
],
"invoices" : [
{
"number" : 5,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "RM69340CY2UTAGZXOJC2WCR7JKBIAJKLSSAHBZBH2LWWOAFFD7SWKTM24O1AXP55UXFWURULM1KIEAJ36H926RGF4XMXJS1DPN6W"
},
{
"number" : 6,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "67G63ZVCHV81IOECQNOPCKSGNRRAM1V8H4TXPF60ZLLBRW7HXAMPRXH462PI6S07KBCJX01P2OTJ17F9NBHUXDY66UZQ2OR6DZU0"
},
{
"number" : 7,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "NWEWFNW3CCK2Q1ZECEGG6TVN5NTGTYXU19J7R8B1FUC4QA37BWPBAANZNDXCWM4V94WC9Z7972N7LNSMSO3NC9OM85LT70Q6RW9F"
},
{
"number" : 8,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "L8PNE3WFCMDRBSFFJMB5DABE25OKY8TQH4H9HDS9A0FV0LMBKDCTCZQTFBU5ARPBEVWOAQJCW67OC0UL2PWT0A5A02VVD0I4EBKE"
},
{
"number" : 5,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "RM69340CY2UTAGZXOJC2WCR7JKBIAJKLSSAHBZBH2LWWOAFFD7SWKTM24O1AXP55UXFWURULM1KIEAJ36H926RGF4XMXJS1DPN6W"
},
{
"number" : 6,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "67G63ZVCHV81IOECQNOPCKSGNRRAM1V8H4TXPF60ZLLBRW7HXAMPRXH462PI6S07KBCJX01P2OTJ17F9NBHUXDY66UZQ2OR6DZU0"
},
{
"number" : 7,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "NWEWFNW3CCK2Q1ZECEGG6TVN5NTGTYXU19J7R8B1FUC4QA37BWPBAANZNDXCWM4V94WC9Z7972N7LNSMSO3NC9OM85LT70Q6RW9F"
},
{
"number" : 8,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "L8PNE3WFCMDRBSFFJMB5DABE25OKY8TQH4H9HDS9A0FV0LMBKDCTCZQTFBU5ARPBEVWOAQJCW67OC0UL2PWT0A5A02VVD0I4EBKE"
},
{
"number" : 5,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "RM69340CY2UTAGZXOJC2WCR7JKBIAJKLSSAHBZBH2LWWOAFFD7SWKTM24O1AXP55UXFWURULM1KIEAJ36H926RGF4XMXJS1DPN6W"
},
{
"number" : 6,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "67G63ZVCHV81IOECQNOPCKSGNRRAM1V8H4TXPF60ZLLBRW7HXAMPRXH462PI6S07KBCJX01P2OTJ17F9NBHUXDY66UZQ2OR6DZU0"
},
{
"number" : 7,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "NWEWFNW3CCK2Q1ZECEGG6TVN5NTGTYXU19J7R8B1FUC4QA37BWPBAANZNDXCWM4V94WC9Z7972N7LNSMSO3NC9OM85LT70Q6RW9F"
},
{
"number" : 8,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "L8PNE3WFCMDRBSFFJMB5DABE25OKY8TQH4H9HDS9A0FV0LMBKDCTCZQTFBU5ARPBEVWOAQJCW67OC0UL2PWT0A5A02VVD0I4EBKE"
},
{
"number" : 5,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "RM69340CY2UTAGZXOJC2WCR7JKBIAJKLSSAHBZBH2LWWOAFFD7SWKTM24O1AXP55UXFWURULM1KIEAJ36H926RGF4XMXJS1DPN6W"
},
{
"number" : 6,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "67G63ZVCHV81IOECQNOPCKSGNRRAM1V8H4TXPF60ZLLBRW7HXAMPRXH462PI6S07KBCJX01P2OTJ17F9NBHUXDY66UZQ2OR6DZU0"
},
{
"number" : 7,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "NWEWFNW3CCK2Q1ZECEGG6TVN5NTGTYXU19J7R8B1FUC4QA37BWPBAANZNDXCWM4V94WC9Z7972N7LNSMSO3NC9OM85LT70Q6RW9F"
},
{
"number" : 8,
"region" : "D25DL884-BH5Y-37A8-OE14-ZI6RY75VZQEA",
"text" : "L8PNE3WFCMDRBSFFJMB5DABE25OKY8TQH4H9HDS9A0FV0LMBKDCTCZQTFBU5ARPBEVWOAQJCW67OC0UL2PWT0A5A02VVD0I4EBKE"
}
]
},
{
"guid" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"customer" : "6F6TMD0K-I55I-Z7WI-Z3Q4-YR8TTZUXP2IU",
"name" : "801DE2BYJAB95LB5UIHM",
"orders" : [
{
"number" : 9,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "T7W2HPEKM8GPFIOL2M1M9YDRWEVLFSL9EHDF59JPUNPN9Z4E7FI5NZPSB3XMC5LTKTWS9D76JYUW3UY67G8JUGCXRO1F8EEQODZN"
},
{
"number" : 10,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "SO234GVOJNMQCB5HVPXSZRHMNLY4S0HH3BINA1E11RC1DAECRP6AVHMZ933HGES2E3S3EXLX6COZ4GYCKJPRYDRV7BX3X14ONEF2"
},
{
"number" : 11,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "4K0TRFP45PGM0WW91BWK8O0YRVNHTLEYBDAW1BDP4S9H13TLAHTMPQ6KL3LD6Q7KJQLZNPKC33VKV8MTY8SO9UNDEQ7IOKRYD2U3"
},
{
"number" : 12,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "GJXL5R4VHIXOZ12EW91ZLDJ8NLREYC68FM84XB8D8M43T2REX2F9IWZEO9JR65TC81ASCMN0OTWKDXPRZIF70TJHKZW7DCIQSFPV"
}
],
"invoices" : [
{
"number" : 9,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "X6T6RNEFEANVJ8D30NKOJ7ZX9BJK21GATP4KR52LJWRY0LW0BBZ2ZG1XH8STW9ZPB94ZYGHIOD5BOXOWI92LN7Z8QV68T8SJAMT1"
},
{
"number" : 10,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "ZB6PBQUALQM7GDPMKXZK1GAH5IEV6LNO8W077X0R9EPSEC8SVSNNIW651S78F9S2PQMQ9RKUA9P6GW5S9OS4IEYSB8JNW91TEO7A"
},
{
"number" : 11,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "AUFDJTX44ATJT5HSVRL8M0N9RWZ5I8TAIXBAZF3SZF31K9SNINA1OXLAU26BI2XERQ4K7828RY8DE2KJGJTJ8DXMEJW1CTKPOJZN"
},
{
"number" : 12,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "5KPRLJKXVOPYY7X948OY4D1CV4N899NTFQY4ZQY7ZVSU5ZKEE6UMAQSGH5778SDKD2GI2EJ0CKI8D9U1BI5Y75WPTQ27A28PP223"
},
{
"number" : 9,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "X6T6RNEFEANVJ8D30NKOJ7ZX9BJK21GATP4KR52LJWRY0LW0BBZ2ZG1XH8STW9ZPB94ZYGHIOD5BOXOWI92LN7Z8QV68T8SJAMT1"
},
{
"number" : 10,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "ZB6PBQUALQM7GDPMKXZK1GAH5IEV6LNO8W077X0R9EPSEC8SVSNNIW651S78F9S2PQMQ9RKUA9P6GW5S9OS4IEYSB8JNW91TEO7A"
},
{
"number" : 11,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "AUFDJTX44ATJT5HSVRL8M0N9RWZ5I8TAIXBAZF3SZF31K9SNINA1OXLAU26BI2XERQ4K7828RY8DE2KJGJTJ8DXMEJW1CTKPOJZN"
},
{
"number" : 12,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "5KPRLJKXVOPYY7X948OY4D1CV4N899NTFQY4ZQY7ZVSU5ZKEE6UMAQSGH5778SDKD2GI2EJ0CKI8D9U1BI5Y75WPTQ27A28PP223"
},
{
"number" : 9,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "X6T6RNEFEANVJ8D30NKOJ7ZX9BJK21GATP4KR52LJWRY0LW0BBZ2ZG1XH8STW9ZPB94ZYGHIOD5BOXOWI92LN7Z8QV68T8SJAMT1"
},
{
"number" : 10,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "ZB6PBQUALQM7GDPMKXZK1GAH5IEV6LNO8W077X0R9EPSEC8SVSNNIW651S78F9S2PQMQ9RKUA9P6GW5S9OS4IEYSB8JNW91TEO7A"
},
{
"number" : 11,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "AUFDJTX44ATJT5HSVRL8M0N9RWZ5I8TAIXBAZF3SZF31K9SNINA1OXLAU26BI2XERQ4K7828RY8DE2KJGJTJ8DXMEJW1CTKPOJZN"
},
{
"number" : 12,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "5KPRLJKXVOPYY7X948OY4D1CV4N899NTFQY4ZQY7ZVSU5ZKEE6UMAQSGH5778SDKD2GI2EJ0CKI8D9U1BI5Y75WPTQ27A28PP223"
},
{
"number" : 9,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "X6T6RNEFEANVJ8D30NKOJ7ZX9BJK21GATP4KR52LJWRY0LW0BBZ2ZG1XH8STW9ZPB94ZYGHIOD5BOXOWI92LN7Z8QV68T8SJAMT1"
},
{
"number" : 10,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "ZB6PBQUALQM7GDPMKXZK1GAH5IEV6LNO8W077X0R9EPSEC8SVSNNIW651S78F9S2PQMQ9RKUA9P6GW5S9OS4IEYSB8JNW91TEO7A"
},
{
"number" : 11,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "AUFDJTX44ATJT5HSVRL8M0N9RWZ5I8TAIXBAZF3SZF31K9SNINA1OXLAU26BI2XERQ4K7828RY8DE2KJGJTJ8DXMEJW1CTKPOJZN"
},
{
"number" : 12,
"region" : "F4NN5J7N-IGF1-QNMF-8RXY-NDH918LH72R7",
"text" : "5KPRLJKXVOPYY7X948OY4D1CV4N899NTFQY4ZQY7ZVSU5ZKEE6UMAQSGH5778SDKD2GI2EJ0CKI8D9U1BI5Y75WPTQ27A28PP223"
}
]
}
]
}
],
"skippedrecords" : "0",
"resultcomplete" : "1"
}
}
« Last Edit: November 30, 2023, 05:56:34 AM by Niels Larsen »

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Web Service Method - parallel nested tables
« Reply #3 on: November 30, 2023, 06:10:28 AM »
Hi Niels Larsen,
I dont fully undestand what you are tryinig to do but If you need to retreive only the invoices from each customer, in the customer node... at least you need a customer Field and a key in the invoices file.
What the view is doing is ok, you are asking for all the invoices in the regison inside each customer.

If you need a help doing the view make an ABC Browse linking the files as you need, once this browse shows what you want, just see the souce and duplicate it in the API method

Regards
« Last Edit: November 30, 2023, 06:13:01 AM by Alberto »
-----------
Regards
Alberto

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Web Service Method - parallel nested tables
« Reply #4 on: November 30, 2023, 08:50:53 PM »
Hi Alberto

There are several regions per customer, so I think the structure is ok.
I understand what you mean, but that is not the point of my challenge. The data structure is intended only as a test.
The challenge is to have two different arrays under each region and I don't think I can achieve that via a clarion view structure.

Regards Niels

seanh

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
    • Email
Re: Web Service Method - parallel nested tables
« Reply #5 on: December 04, 2023, 03:27:06 AM »
I think I understand what you want.  and no, a view cannot do that.
The View is doing exactly as it should in duplicating everything.  A view does that, it flatterns the data and gives you everything.
If you're backend is TPS, you need to do some programming, maybe with a temporary table.
What you want in SQL terms is called a UNION, and you need to create that as an SQL VIEW on the backend. 


Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Web Service Method - parallel nested tables
« Reply #6 on: December 04, 2023, 05:50:23 AM »
Hi Seanh
I totally agree. My wish is to insert 2 arrays at the same level and still have the automatic documentation generated. My hope is that I can insert an array into the existing structure in another way than via a view. I can't quite see whether the template allows for this or whether there is an embed point to do that.

Just read your reply again. It's not a SQL union I'm looking for. Invoice and Order could be two completely different tables with completely different structures.
« Last Edit: December 04, 2023, 10:27:29 PM by Niels Larsen »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: SOLVED: Web Service Method - parallel nested tables
« Reply #7 on: December 06, 2023, 10:27:40 PM »
Niels,

Please post some data with your example, and a hint on what parameter to call the test api with (ie customer number) to see some result in the api.

Cheers
Bruce

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: SOLVED: Web Service Method - parallel nested tables
« Reply #8 on: December 07, 2023, 11:06:57 PM »
Hi Bruce

Press the red button "Create Test Data" on the Web Server Window. CustomerNo 1-10.

/Niels