Skip to main content
Participating Frequently
May 14, 2024
Question

Nested data in a list box

  • May 14, 2024
  • 2 replies
  • 576 views

How do i get my data object back out of a list box.

I have an object called rawData as follows

rawData = {name: nameField,
title: titleField,
Day1: Wed,
Day2: Thur,
Day3: Fri,
social: socialBox};

i am sending it to a list box with

toListBox.insertItemAt(rawData.name, rawData, 0);

I then want to retrive some data out of the list box such as but if returns "undefined"

app.alert (toListBox.value.name);

how can i get it to return the string stored in name?

    This topic has been closed for replies.

    2 replies

    try67
    Community Expert
    Community Expert
    May 14, 2024

    Try this:

    toListBox[this.getField("toListBox").value]

    Participating Frequently
    May 14, 2024

    it didnt work 

    mycode is below with the console log after it 

     

    rawData = {name: nameField,
    title: titleField,
    Day1: Wed,
    Day2: Thur,
    Day3: Fri,
    social: socialBox};

    var toListBox = this.getField("List Box1");

    toListBox.insertItemAt(rawData.name, rawData, 0);

    app.alert (toListBox[this.getField("toListBox").value]);

     

    log says

    TypeError: this.getField(...) is null

    try67
    Community Expert
    Community Expert
    May 14, 2024

    The field name you used is incorrect.

    jane-e
    Community Expert
    Community Expert
    May 14, 2024

    @nathand16798825 

     

    Please tell us which Adobe application you are using. We are happy to move your post to the appropriate board.

     

    Jane

     

    Participating Frequently
    May 14, 2024

    I am using Adobe Acrobat

    jane-e
    Community Expert
    Community Expert
    May 14, 2024

    Thank you @nathand16798825! I've moved your post from Using the Community (for forum questions) to the Adobe Acrobat board for you.

     

    Jane