Jump to content
  • 0

Change Data Source


JEllington

Question

First I would like to thank all community members who contribute to this forum. I have used Caspio for the past few months and any questions or problems I have had were answered by searching this forum.

Unfortunately, I haven't found any that come close to solving this problem...

I have several company's that use the same table to manage inventory at their location. This is a management problem and possible security risk. I can correct the issue by creating data pages for each company all with identical element fields  and creating copies of the original data source for each company referenced by the respective data page for that company. This of course uses up data pages and creates redundancy that I prefer to steer away from whenever possible.

My question, is there a way to have a single data page and be able to change the data source of the data page before it loads? (all elements referenced within the data page are same for each data source) 

 I am learning java script and have learned a lot from reviewing the examples on this forum. I have reviewed the caspio form elements thread. But have not found any reference to calling the data page data source.
I understand that my train of thought on the work flow of this problem my be incorret and explanes why I cannot find any references to table manipulation on this forum,

 

Either way, I appreciate all observations, suggestions and solutions, on cutting down the redundancy of having multiple data pages all identical, with the exception of the data source. 

 

Jim Ellington

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

first-I am wondering how you are managing your inventory. How do you prevent overselling when users submit almost simultaneously?

 

As to your question, you can use Record Level Security. Record Security lets you filter data within the same datapage based on authentication criteria. If all users in a company can see each other's data, then you would secure based on something like their companyID in their user profile. If data is private by user, then filter by userID.

 

http://howto.caspio.com/authentications-and-connections/authentication/record-level-security/

Link to comment
Share on other sites

  • 0

Thank you for your response aam82, to answer to your question..
Actually I am not selling, but tracking items and or services used by a customer at each of their individual locations. This is exactly why I have a need to put each company in a separate table so I can track each customer and their location separately. With each company assigned their own data source/table, I can then use record level security for each individual company location. Plus if that customer discontinues service I can just delete that customers table and all else in the universe will remain in alignment.

Link to comment
Share on other sites

  • 0

I don't follow your rationale. Normally you would have all data of the same type in the same table, and then create a View to join the tables together, and then filter the View.

companies

customers

items

 

View

customerName-customerEmail-customerStatus-companyName-itemOrServiceName

  where customerStatus != "deleted"

 

 

so forth

Link to comment
Share on other sites

  • 0

Agreed aam82, normally I would have all data of same type in the same table, but in this case each company has their own items and assets that belong to that company, thus the need for separate tables for each individual company. Same as in an accounting program (like quickbooks) you would create individual accounts (or company files in quickbooks) for each company.

Plus now if my customer decides down the road that he would prefer to have his own Caspio account. I can package all data files for the app and just his company tables and its a simple migration to his new Caspio account.

 

At this time I am creating data pages for each company all with identical element criteria and the only exception is the data source. So now.. with 5 different data pages using one company table as the data source, times 4 companies I will use a total of 20 data pages. Where if I could just change the data source in the 5 data pages to the respective company table in the data page, I would only need a total of 5 data pages.   

Link to comment
Share on other sites

  • 0

I still think you shouldn't use separate tables. You should instead be able to filter tables adequately by user or by company.

 

If you need to migrate to a new account, you can filter your table exports by company name, and use the exact same datapages. If you don't have the company name or company code in every record for every table, then you can add that to accomplish what you need.

Link to comment
Share on other sites

  • 0

To point out a "BIG" (pun intended)  reason to separate the tables, is that each company table individually is large. Combining the 4 tables to 1 extremely huge table would increase the table 4 times the size, thus degrading file access performance that is already slow as a singular individual table.

 

Aam82, I respect your opinion and expertise with caspio, I prefer not to argue the logistics on application design and development.

I would however like to know if a data source in a data page can be referenced to change out the data source within a table.

Thank you for your observations.

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