question

kasparlaurenz avatar image
kasparlaurenz asked

Is nested data binding possible in APL?

For example i have following payload to the APL doc.

"input": {
    
    "ARRAY1": [
      {
       
        "ARRAY2": [
          {
        
          },
          {
           
          }
        ]
      },
 ]
}

I bound data to a container ${input.ARRAY1} and now inside that container i have another container where i bound data to ${data.ARRAY2}.
My question how can i access the length of ARRAY2. i tried ${data.length}. Which didnt work..

aplalexa skills
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andy Whitworth avatar image
Andy Whitworth answered

Something like this ?

https://apl.ninja/document/AndyWhitworth/mhmMohsj96rUC2f59xz700PuQPrU5wHZ

Shows two ways of getting the length of ARRAY2

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kasparlaurenz avatar image kasparlaurenz commented ·
works! thank you :)
1 Like 1 ·
kasparlaurenz avatar image
kasparlaurenz answered

Ahh and i forgot to mention that i can in fact access properties inside ARRAY2 by calling ${data.property} so i guess its kinda working. But why can i not get the length of that array

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.