General Discussion

 View Only
  • 1.  DREL to extract single data from repeatable footer (aggregate question)

    Posted 08-28-2023 11:43

    Hi Community

    Hoping for a little guidance / sign posting before I lose the will to live... I have spent the whole day trying to figure out how to get one item of data into my custom excel doc and have to put my hands up in defeat - I've been through the University and online documentation an cannot find a solution that works. I have used custom Excel docs for years and get them to work without any issues but this one has me stumped...

    I have a nested repeatable section:

    • Standard section 1: Collects data for a house (address, etc.)
    • Repeatable Section 2 : Defines the size and name of each room in a house (multiple rooms)
    • Nested Repeatable Section 3 (subset of 2) : Defines the size and details of a wall in the above room (multiple Walls). Data collected includes the number of "paintings" on each wall (not really paintings but using for simplicity)

    Using %a[FieldName][1] etc I can get the names of the rooms listed separately on my excel sheet. Next to that I want to have the number of paintings within that room. This number is recorded in the footer collected via the aggregate function.

    When I use %a[Paintings] or %a[Paintings][1] the output is the data for all rooms:

    I am trying to single out each number but having no joy.

    Is it because the field is calculated in the footer or am I missing something else?

    Appreciate any help/guidance.

    Thanks

    Stephen



    ------------------------------
    Stephen Morrison
    Business Information and Performance Director
    BCA Insulation
    ------------------------------


  • 2.  RE: DREL to extract single data from repeatable footer (aggregate question)

    Posted 08-28-2023 11:46
    Edited by Natalie Tallon 08-28-2023 11:46

    Hi Stephen, I'll look into this and someone will get back to you. Sounds very frustrating! Please find a way to hold on to your will to live ;)



    ------------------------------
    Natalie Tallon
    Product Manager
    ProntoForms
    ntallon@prontoforms.com
    ------------------------------



  • 3.  RE: DREL to extract single data from repeatable footer (aggregate question)
    Best Answer

    Adopter
    Posted 08-29-2023 16:59

    Figured this would be an easy answer but boy was I wrong. It seems like when you look at footer questions, DREL is not returning the selected index - it will always return the full array.

    %a[Paintings][0] or %e[Rooms][0][%a[Paintings]] returns

    It should return 15, but apparently not. I did confirm it returns an actual array by adding a delimiter

    %a[Paintings][0][, ] returns:

    So it's not just returning a string.

    After a ton of experimentation I was able to get an array that is accessible by index.

    I found that each CHILD section contains the footer question data for the parent section it belongs to - and that can be accessed by index.

    %e[Parent][INDEX][%e[Child][0][%a[Question][0]]]

    OR

    %e[Rooms][0][%e[Walls][0][%a[Paintings][0]]]

    This will return 

    The [Rooms] index is the one you need to change to get values for each room.

    %e[Rooms][1][%e[Walls][0][%a[Paintings][0]]] will return:

    Paintings must have an index but it doesn't matter what index you give it. The walls index can be anything up to the number of Walls in that Room, but they are all the same value, so 0 works.

    I'm guessing it's just a bug with the DREL engine not recognizing the index provided. %a[Paintings][0] and/or %e[Rooms][0][%a[Paintings]] should just work.

    Hope this helps and/or restores your will to live.



    ------------------------------
    Calvin Hunter
    Project Manager
    Vipond Inc
    MB
    ------------------------------



  • 4.  RE: DREL to extract single data from repeatable footer (aggregate question)

    Posted 08-30-2023 03:44

    Calvin

    Brilliant. Many thanks for investing the time to look into this. Thank you on three fronts:

    1. You found a solution that works;
    2. Your analysis confirms that I hadn't missed anything obvious in pursuit of a solution;
    3. Will to live restored!

    Many thanks again for taking the time - you have to love the PF Community!

    Thanks

    Stephen



    ------------------------------
    Stephen Morrison
    Business Information and Performance Director
    BCA Insulation
    ------------------------------



  • 5.  RE: DREL to extract single data from repeatable footer (aggregate question)

    Staff
    Posted 08-30-2023 08:12

    Hi everyone! For future reference, this topic describes how to use DREL with repeatable, nested sections. Please note the use of %e versus %a: DREL for Repeatable Sections (prontoforms.com)

    All the best,

    Karen



    ------------------------------
    Karen Cann
    Senior Technical Writer
    ProntoForms
    ------------------------------



  • 6.  RE: DREL to extract single data from repeatable footer (aggregate question)

    Staff
    Posted 08-30-2023 11:37

    Hi everyone,

    @Calvin Hunter, that's a great solution you came up with - amazing! I can tell you that we have confirmed that this is a bug. Thanks for bringing this one to our attention.

    @Stephen Morrison I have submitted a support ticket on your behalf so our Engineering team can get on this and get it all fixed up. In the meantime, however, it looks like you've got a great path forward.



    ------------------------------
    Pat Cooney
    Community Engineer
    ProntoForms
    community@prontoforms.com
    ------------------------------



Reminder: Content posted to our Community is public content.  Please be careful not to post Intellectual Property that you do not have permission to share.  For more information please refer to our Terms Of Use