4 Replies Latest reply: Jun 14, 2017 2:53 PM by Brantley Hobbs RSS

    Automatically add custom property to apps based on owner?

    Brantley Hobbs

      All,

       

      I have a situation where we have several rim nodes set up for various clients at their location and we run the central node locally.

       

      Our clients are unrelated, and we do not want their data to end up on each other's servers, and because some of their data has legal baggage (HIPAA, FERPA), we do not want them actively working on it on a consume node in our network.

       

      We have created a custom property associated with a sync rule that keeps a particular client's apps restricted to their consume node only (and of course the copy on our central node that cannot be avoided).  This all works well, except that when a client creates a new app in their "My work" on their local consume node, because that app does not have the custom property, it disappears when the node syncs with the central node a few seconds later.  It comes right back when the property is assigned.

       

      I have tried to work around this by also assigning this property to certain users, and then having a sync rule like this:

       

      ((node.@SyncKey=resource.owner.@SyncKey))

       

      (Where "resource" is App_*, naturally.)

       

      This does not work either.

       

      Does anyone have any suggestions on how to accomplish this?  Could we make an API call that assigned the property based on who the owner was?  Is there a way to assign the property based on what node the app was created on?

       

      Thanks for any suggestions!

        • Re: Automatically add custom property to apps based on owner?
          Shraddha Gajare

          You will also have to sync apps which are not published

          refer Multi-node scenario: Production deployment allowing development ‒ Qlik Sense

           

          resource.stream.name.Empty() proprty will hep you to identify unpublished apps.

            • Re: Automatically add custom property to apps based on owner?
              Brantley Hobbs

              Unfortunately this will not work for me (or I am too dense to understand how it could work).

               

              My scenario is closer to the "Geographically Dispersed Site" scenario, with the following rules:

              • Each geographically distant site is a single node running all services necessary
              • Each geographically distant site for legal reasons cannot share their apps and data with other rim nodes
              • For the same legal reasons, we cannot provide a common development node for all unpublished apps; therefore the clients may as well develop on the same node as their production (it's very low load)
              • We use a sync rule to allow apps to sync to a node only when the app and the node have a matching custom property

               

              The problem is that when a user creates an app locally on their node, it disappears because it doesn't have that custom property set.  How can I automatically add this property to their newly created apps?  Publish status does not matter to me, really, it's the app owner.

               

              I did try adding the custom property to user accounts in the QMC, and altering the sync rule to check resource.owner.@prop, but that didn't seem to work.

                • Re: Automatically add custom property to apps based on owner?
                  Scott Joelson

                  Brantley - I'm interested to hear if you found a solution.

                    • Re: Automatically add custom property to apps based on owner?
                      Brantley Hobbs

                      Scott,

                       

                      It turns out that I was apparently not creating my sync rule correctly.

                       

                      We ended up creating a custom property named "SyncKey", which could be set on both nodes, apps and users.  Then we created two rules, one to sync based on an app's property and the other to sync based on a user's property.  I did two separate rules because I didn't want to risk breaking the one that worked in the first place (the app rule).  These could probably be done in a single rule, although now that I think back on it, I think that's what I tried in the first place, and it didn't work.  I'd do two separate rules if I were you.

                       

                      Here's the conditions for the owner based rule

                      • Resource Filter:  App_*
                      • Conditions:  ((node.@SyncKey=resource.owner.@SyncKey))

                       

                      Here's the conditions for the app based rule

                      • Resource Filter: App_*
                      • Conditions:  ((node.@SyncKey=resource.@SyncKey))

                       

                      An example (this example assumes that you have disabled the out-of-the-box sync rule that syncs everything):

                      Let's say you have a rim node in a branch office.  You could create a value in the SyncKey property called "branch", then go set the SyncKey property on that rim node to "branch".  If you have apps that you know you want to sync to that location, you can now set that same property to "branch" on those apps, and they (and only they) will sync to the branch rim node.  Now, let's say you have a user that you know develops on that node only, and can't get to your central node.  You can also set that property on that user to "branch".  Boom, any apps owned by that person are ALSO synched to the "branch" node.