Include custom table in PDF attachment




I’m trying to display the results of a custom table on a pdf – I can use sgapigetvalue etc to display the data for simple question types but am stuck on displaying the data from a custom table.

Could you direct me to an example where data is gathered from a custom table and then included in a pdf for attachment to an email?


Many thanks,



Scout Activity Centres answered
    Lola Gill 6.99K Rep.

    While there likely aren’t any very specific examples for your exact use case, in looking at the information located at the bottom of this article:

    “You can call sgapiGetValue on a custom table as well. it will return nested arrays.”

    As such, something like the following would output an array of the subquestion answers for a Custom Table, where ‘5’ is the ID of the overall Custom Table question.

    %%output .= sgapiPrint_R( sgapiGetValue(5) );

    I hope this helps!

    Scout Activity Centres commented
      • Hi Lola Gill,

        Thank you for your answer, i only just realized you’d answered when i accidentally stumbled across my own question! Unfortunately this is the same stage i’d gotten to already – but the output is the full nested array and i cant work out how to break this up – switching in the ID for the subquestion just returns blank.

        What i’m really looking for is an example of how to turn the data from a custom table into a user friendly table on a pdf – exactly as it comes out on the survey summary PDF.

        I assume to do this i’ll need to extract each individual answer from the custom table and then define where to locate that answer on the output. But I just can’t figure out how to pull out a specific answer from the array.

        For instance the first column of my custom table allows the user to select an answer from a drop down list of 30 answers. How would I go about extracting the specific option my user picked for that 1st column on say the 2nd row of the table?

        Ca you point me in the right direction?

        Thanks, Dan



      Question stats

      • Active
      • Views2946 times
      • Answers1 answer
      • Followers1 follower