Question

Photo of Don Smallman

0

Data Transformations

Hi, is there a manual or Video that shows how to create Data Transformations?

Thanks!

  • Photo of David Leigh

    0

    Hi Don,

    I don't think there is any documentation or video around this topic at the moment.

    However, if you have downloaded the Rock code, check out the ParentTransform.cs file.
    It contains the implementation of the "Person Parent Transformation", and it could be easily used as a template to create other transforms.

    The implementation itself looks fairly straightforward - it appears that there's not much code required to create a simple transformation.

    Hope this helps!

     

    • Don Smallman

      Thanks David. I am not a programmer, so I do not have the code, other than what I installed on the website. I looked for that file on my website, and did not find it. So even if I had it and was able to change it, I would not know what to do with it :-). Hopefully there will be more added soon, or a manual will be created. I can do it if I have instructions.
      I have been asking to be able to filter my list of members for SMS message, so it would only give me people with cell numbers. I thought maybe a transform would be good for that.

    • David Leigh

      Don, a transformation is implemented entirely in code, so it requires some programming knowledge to create a new one.
      This is because the purpose of the transformation is essentially to do things that are too complex to configure using Data Views.


      If I understand you correctly, what you would like to do is to create a Data View that selects a filtered set of Phone Number items, and then translate that result into a set of the Person items that "own" those phone numbers? Unfortunately, a transform will not do that for you either - it can't change the type of the item returned by the Data View (ie. Phone Number --> Person).
      I have similar problem at the moment where I would like to get a set of Person items with specific associated Notes. I can't see an easy way to solve this, because creating a new Data Filter Field for every one of these cases (yours, mine, everyone else's) would result in an unmanageable list of filter fields.


      My best solution to this so far is one for the suggestion box: Add an "Outputs To" field in the Data View that allows the type of Entity in the result set to be a related (but different) Entity than the one selected in the "Applies To" field. So in your case. the Data View "Applies To" a Phone Number, but "Outputs To" a Person, so the conditions are applied to the Phone Number, but the output set can be used as a Person Data View.
      Unfortunately this is not a quick fix - but I think it would solve both of our problems, and also quite a few that we haven't encountered (yet)! Sorry, I don't have a solution for your problem at the moment - just the hope of things to come!