Jump to content
  • 0

Using a Web Form to Add Multiple Entries


MeralomaFC

Question

Hey everyone,

I'm running a raffle for my soccer team, and I need to keep track of ticket sales.

My data table is very simple:

  • Ticket_No (prefixed autonumber)
  • First_Name
  • Last_Name
  • Player_Name (drop down)

I would like the players to be able to input their ticket sales into the database using a web form.

I would like for them to have the option to input 'number of tickets' and then when they hit submit, it would add a new row into the database for the number entered into that field. So if they enter '3' it would enter 3 rows into the database, each with the same First Name, Last Name & Player Name, but each with a unique Ticket No. I would then like to be able to have the post-submission pop-up to display the ticket numbers. e.g. "The ticket number for [@field:First_Name] [@field:Last_Name] is: [@field:Ticket_No]." (Even if it has to repeat that line each time for each entry, that would be fine.

I figured this would be a pretty simple thing to create, but I'm having a lot of issues trying to find any solution, so I'm hoping someone here will be able to help!

I thought about switching strategies and using list enter/edit, but I was worried about people accidentally inputting over the top of each other, plus I'm assuming it isn't live, so if multiple people enter at the same time, it wouldn't work.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hello @MeralomaFC,

I have one idea and it requires using only Caspio standard features. Maybe someone can share another idea.

I don`t think that we can display the Prefixed Autonumber(Ticket_No ) in the popup right after clicking the Submit button since this is an auto-generated value. It appears in the table only after submitting the new record.

So, you may try these steps:

1) Add the Number_Of_Tickets field to your table (data type is Integer)

xhkzvUy.png

2) Create a second table with the same design, just change the DataType for the Ticket_No field to Text(255)

OCjKtNe.png

3) In the first table you may create a Triggered Action(if this option is included in your plan). 

LU2xUXf.png

 

The Trigger works on data insert and inserts the number of records that is equal to the Number_Of_Tickets into the second table.

For example:

xOuwbe5.png

And these are the records that are inserted by the Trigger into the second table:

jLVIFAQ.png

 

4) To display this data to the user we need 2 DataPages:

* For example, Details DataPage that is based on the second table, on the 'Search and Report Wizard - Search Type' you need to select the 'Filter data based on your pre-defined criteria' option and receive the Ticket_No value as an External parameter. Since this is Prefixed Autonumber you need to add manually the 'InsertRecord' before the field name:

JIk3QyY.png

* Submission Form that you mentioned based on the first table. On the 'Web Form Wizard - Select Fields' you need to check this checkbox to pass the Ticket_No value as a parameter:

oRxgXi0.png

This article regarding the Passing Parameters can be helpful https://howto.caspio.com/parameters/passing-parameters/

And on the 'Web Form Wizard - Destination and Messaging' you need to select the second DataPage as the destination

TjN8vdg.png

 

As a result, once the Submission form is submitted, the user is redirected to the Details DataPage where all the records are displayed. 

It can be a Tabular Report DataPage instead of the Details, for example:

gAutArV.png

Hope this helps.

Link to comment
Share on other sites

  • 0

What a phenomenal response, thank you so much for taking the time to provide all that detail. I'll let you know how I get on.

EDIT: Can't use Triggers on a free account, and since my project is only going to last 3-4 weeks, I can't justify getting a paid account (and the free account won't be active for long enough). Thanks for your help, though.

Edited by MeralomaFC
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...