Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Data not saving in Dynamic Table

Avatar

Level 2

My form has been reader enabled and all information can be saved except for data entered by the user into the dynamic table.  

Do I need to change the Data Binding?  

https://acrobat.com/#d=SWkT2mrJBJbxk*QJGmN0Ng

Appreciate any help!

Tracy

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

ok I discovered the root of all evil.

To solve this you need to replace the script that caculates the calendar dates in the dynamic table with another one.

Go to the Table's calculate event an delete the script.

Then select the Date field in the first table row and add this script to its change event.

var StartDate = $event.newText

var DateFormat = "MM/DD/YY"

 

if (StartDate ne $event.prevText) then 

          var selectedDate = Date2Num(StartDate, DateFormat)

            var selectedDay = Num2Date(selectedDate, "DD")

          var selectedMonth = Num2Date(selectedDate, "MM")

          var selectedYear = Num2Date(selectedDate, "YY")

          var firstDay = Date2Num(Concat(selectedMonth, "/", "01/", selectedYear), DateFormat)

          var lastDay = 0

          var dayNumber = firstDay

 

          $event.change = Num2Date(firstDay, DateFormat)

 

          for i = 0 upto 30 step 1 do

                    if (Num2Date(firstDay, "MM") eq Num2Date(dayNumber, "MM")) then

                              dayNumber = dayNumber + 1

                              lastDay = dayNumber

                              Table._Row.addInstance(1)

                              Table.Row[i].Date = Num2Date(dayNumber - 1, DateFormat)

                              Table.Row[i].Day = Num2Date(dayNumber - 1, "EEE")

                    endif

          endfor

          Table._Row.removeInstance(Table._Row.count - 1)

endif

https://acrobat.com/#d=qEVfk*AbNz5qfmJqF*BovA

View solution in original post

5 Replies

Avatar

Level 10

Hi,

I could not see any problem so far.

Times I entered into the dynamic table got saved and recovered by Reader as exspected.

Avatar

Level 2

I just tried it again.  Still not saving anything in the table.   I am changing the file name, of course.  I also had someone with Reader try and the information was not saved by him either.

Avatar

Level 10

OK, now I also see what you mean.

Weird ... Will check that later

Avatar

Correct answer by
Level 10

Hi,

ok I discovered the root of all evil.

To solve this you need to replace the script that caculates the calendar dates in the dynamic table with another one.

Go to the Table's calculate event an delete the script.

Then select the Date field in the first table row and add this script to its change event.

var StartDate = $event.newText

var DateFormat = "MM/DD/YY"

 

if (StartDate ne $event.prevText) then 

          var selectedDate = Date2Num(StartDate, DateFormat)

            var selectedDay = Num2Date(selectedDate, "DD")

          var selectedMonth = Num2Date(selectedDate, "MM")

          var selectedYear = Num2Date(selectedDate, "YY")

          var firstDay = Date2Num(Concat(selectedMonth, "/", "01/", selectedYear), DateFormat)

          var lastDay = 0

          var dayNumber = firstDay

 

          $event.change = Num2Date(firstDay, DateFormat)

 

          for i = 0 upto 30 step 1 do

                    if (Num2Date(firstDay, "MM") eq Num2Date(dayNumber, "MM")) then

                              dayNumber = dayNumber + 1

                              lastDay = dayNumber

                              Table._Row.addInstance(1)

                              Table.Row[i].Date = Num2Date(dayNumber - 1, DateFormat)

                              Table.Row[i].Day = Num2Date(dayNumber - 1, "EEE")

                    endif

          endfor

          Table._Row.removeInstance(Table._Row.count - 1)

endif

https://acrobat.com/#d=qEVfk*AbNz5qfmJqF*BovA