Jump to content
  • 0

Create multiple records in “child” table conditionally


Alison

Question

Hi,

Can someone share a solution which allows me to create multiple records in “child” table conditionally? 
I have a table “Parent” in which there are two fields “date from” and “date to”, so I need to create 3 child records if for an example I select date from 09/28/2018 and date to 10/01/2018.

Thanks,
 

Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hi @Alison,

You can design Trigger in such a way which allow you to achieve the desired functionality.

You need to make sure that:

1. Your parent/child table has one-to-many relationship;

2. You create a special table which will be used as insert template.

3. Please note that you would need to list the same number of records in insert template as the number of days which you could have in the date range.

4. You need to create a Trigger.

You may import my example into your account and check the structure there. 

Regards,

vitalikssssss

Submit_multiple_records_date_range_1_0_2018-Sep-28_1423.zip

Link to post
Share on other sites
  • 0

Hi @kcastagnaro,

Well, Caspio has release some Triggered Action enhancement called "Loops" that could simplify the solution.

As of now you would need to have two tables (i.e. three before). First table would hold event name and start and end date. The second table would hold each day of the event as a separate record. So the Triggered Action would look like the following:

707da63f2e12.png

The package with tables and Triggered action here.

Hope this helps.

Regards,

vitalikssssss

 

Link to post
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...