Is it possible to create custom global merge variables on the Skuid Platform?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
Is it possible to create custom global merge variables? I'm wanting to build a multi-tenant application in which I need to maintain session information.
Photo of Mark Ebersole

Mark Ebersole

  • 570 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
You can't add new global merge syntax but if you need to get your information through merge syntax you can create a UI only model, add fields to the model, modify the fields with the session information and access the information using model syntax {{$Model.modelname.data.0.FieldName}}.

What exactly are you trying to do? Do you know that you can use javascript in skuid with snippets?
Photo of Mark Ebersole

Mark Ebersole

  • 570 Points 500 badge 2x thumb
I saw that somewhere.  Just getting started learning Skuid.  Seems pretty powerful but so many new things to learn and the approach is different that the traditional C# programming approach.

Here's what I'm trying to think about.  If I have 100 customers in my database, each with their own companyid, I want to filter any data I show this customer by their companyid.  I plan on having a login page where they present their credentials and I look up their companyid.  I store this ID in my "session table" and use it to filter all other information for them.  I will also want to capture role, etc.

I've built a large multi-tenant application in the past on a traditional web platform and I'm trying to emulate my approach in Skuid.  I think I can do it but big learning curve.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
I should add that you can clone one of the built-in profiles and customize that clone. That's an important piece of what I just described. To do this, you'd click Configure > Profiles, and click the pencil for the profile to clone. The next page will offer a Clone button in the top right corner. Once you've done this, you'll be able to fine-tune that profile, say for use with Company Q users. 
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Great information. Thanks Mark!
Photo of Mark Ebersole

Mark Ebersole

  • 570 Points 500 badge 2x thumb
Hi Mark,
Thanks for responding.  There's a lot going on here, both in what you're providing me and what I'm trying to do.  Skuid doesn't seem to offer what I want exactly right out of the box but I'm pretty confident that there are viable work-arounds.
Would it be possible to have a phone call to discuss more thoroughly?
Thanks,
Mark
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Mark Ebersole,

Can you please post your findings when you figure it out? This page could be really helpful for future questions.
Photo of Mark Ebersole

Mark Ebersole

  • 570 Points 500 badge 2x thumb
Yes.  In a nutshell, I'm wanting to build a SaaS product using Skuid that allows my customers to assign their own users with roles(profiles), login ID's/passwords, and security level(RO/RW).  Each customer would have their own company ID and all related data would be identified by that company ID. That means that each set of data presented would be filtered by that ID.  

Essentially, I'm building a SaaS product sitting on top of your SaaS product.  API's would be nice to access all your existing user/authentication services but most of it can be built on top.  All my users would first come to my public page that would have a login link that presents a page to collect loginID and password.  I would have to store that information for their session globally and use it to filter all aspects of the app.  

A newly acquired customer would be assigned a Security Admin role by me that would allow them, in turn, to do all the remaining provisioning for their company.

I'm sure there are ways to get this to work and I'll report back when we figure it out.
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Mark,

You will want to use record sharing to govern access to the records themselves.  Salesforce has good support for this.  Look at the Sharing Rules paragraph here->  https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_bulk_sharing_understan...

You may be able to adjust sharing settings and use criteria based sharing.  This will keep you in the declarative world.  If not, you can create some Apex classes to handle the assignment of access per record.

Thanks,

Bill
Photo of Mark Ebersole

Mark Ebersole

  • 570 Points 500 badge 2x thumb
Hi Bill,
Thanks for replying.  However, I'm not using the Salesforce version of Skuid.  I'm using the Skuid Platform hosted at Amazon Web Services.
Mark
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Mark,

That's great!  You will definitely want to follow Mark DeSimone's advice regarding how to secure your data.

Best of luck!

Bill
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
He's not using Skuid for Salesforce. He's using Skuid Native.
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Oh! Just read Mark DeSimone's answer. Should have looked first!