PerfectForms Forums » General

Bug when counting table rows

(5 posts)
  1. jimmyc
    Member

    I have a table that I am using to give users the ability attach to any number of attachments to a form. The table has an attachment column and a button colomn(delete button). To make life easier for the user I have added a behavior when my attachment page is opened. It has a simple branch with an advanced condition as such:

    Count(List: tblAttachments - Delete Button Column - All Rows) < 1

    Everytime I open the page a row is added, instead of stopping at the first one. So I added a field to the page and before the branch counts the number of rows, i added a set property action with a formula also using Count(List: tblAttachments - Delete Button Column - All Rows). Everytime that page is loaded that field is still set to 0, so its almost like the count function is broken? Not sure whats going on here.

    Posted 1 year ago #
  2. jimmyc
    Member

    Hmm looks like Count doesnt count the row if you are pointing it to a button field or an attachment field with nothing attached. I added a hidden "index" text field column that has a default text value and set the action to count that index column and its working correctly now..weird.

    Posted 1 year ago #
  3. ijobling
    Member

    Please raise such things in the support ticket where you can upload your form so we can see what you are actually doingn would need to see what you are doing and a full explanation of what the intent is, but perhaps look at running your form in DEBUG mode to see what the scripts are doing may help you in the first instancee

    Having said that what is it that you are trying to do to 'make life easier' for your user ?

    Maybe all you need to do on the 'page is opened' is to use the SetTableRow behaviour with the 'add row' option if you want to give them an 'active' row to attach to, and if you want is for them to delete a specific row just use the SetTableRow 'delete current row' option so they can click the button to delete that row

    Posted 1 year ago #
  4. jimmyc
    Member

    I dont think this really needs a screenshot. Create a table on a page with two columns: a button column and an attachment column. Then add multiple rows to the table. Now run a behavior that counts the number of rows. If you haven't attached anything it does not count the rows whether you are counting by the button column or the attachment column.

    Posted 1 year ago #
  5. ijobling
    Member

    your second post (when you mentioned adding in the hidden text column) was posted as the reply was being composed.. so didn't see that...( common thing in forums.. hence my preference in using the support ticker)
    but what you've done and seen is expected.. the 'count' would need something to actually count in terms of data entry. Buttons and attachments are special fields so wont' count

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in or register to post.

Contact

1917 Palomar Oaks Way
Suite 160
Carlsbad, CA 92008
866.900.8588

  picture  picture  picture  picture