Jump to content
  • 0

table variables


sfa71

Question

trying to find examples or best practices around defining and use tables variables.  this forum had a question in 2020 that had an unofficial .pdf file attached that has been removed.  Has anyone used the table variables successfully and live to tell about it.  I've blown out my record count in a trigger and I want to load table variables to possibly avoid some thrashing.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hello @sfa71,

First of all, you may check this article https://howto.caspio.com/triggered-actions/triggered-action-elements/variables/

There are 2 common use cases for using Table Variables:

1) To send an email with the list of values.

For example, there is the table that stores events:

wNJrpx7.png

 

And I would like to receive a reminder with the list of events that will take place tomorrow.

The Task design is the following:

CmkBtxU.png

 

Here is the email example:

TGXxh0J.png

 

2) To add a Table variable as an auxiliary table to store some data or to define a table structure (one of the examples is described in this article https://howto.caspio.com/tech-tips-and-articles/generating-personalized-email-reports/)

 

So, the Table variable is the right choice when,  for some reason, you need to select not a single value, but a set of data. It can be 1 record with multiple fields, or it can be multiple records with 1 field or multiple fields. 

If you need assistance with a particular use case, please provide more details. 

Link to comment
Share on other sites

  • 0

thanks for the response - so my issue is I have a trigger that has a "for each record in" process over a large table and the trigger goes over the 10K records limit.  So I want to get a subset of the table created - thus I was thinking maybe a variable table would help but I'm not think that anymore.  So I was moving toward a dynamic data-qualifying view but in the trigger, I don't seem to be able to select a view as a data source.   I had a brute force method working until the tables got too big.

Link to comment
Share on other sites

  • 0

I think, with much struggle I figured it out.    In this business, only a 2 day struggle is a win.   Loaded the table, updated it iteratively and selected table elements in the calculations.  

shared here - long trigger so I had to scroll and record

https://www.dropbox.com/scl/fi/601x4xlsduxk8y9nvrby7/Trigger-with-table-variables-2024-05-30_08-51-00.mp4?rlkey=omj7hnr3apg7o3jzotqxwlsz0&st=domtuqqt&dl=0

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...