
User attributes in front-end fields
User attributes that can be used in field definitions via Mustache syntax
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
the other thing as added this ability to reference user attributes in SQL so see if I can type on live demo and this um want to Dem with this because I want to see if people have strong feelings about this way of referencing but basically like user attributes that's just like the bag of user attributes user attri this is one of our system user attributes and then as strings to say like make this a string literal and then we add hope I didn't type up I didn't typo I've got this cool little what else would you ever make that is super useful sorry what else would you ever make it besides I don't know a string or a number like what what else would you
make it besides what it is you can make it a numeric literal well what it yeah so like it could it they're typed but they lose their type info when they get to this layer which is a little awkward um I see but yeah and the other thing that it leaves open is the possibility that we could allow them to be raw columns like basically like it would be like as column or something or like it and that would be could in theory select a dynamic column based on a user attribute um just that just yeah we could Plum the type in which case we could drop this whole as string thing but then as long as we weren't as long as we were sure
we never wanted the dynamic column thing that's the thing like if we just made the reference this part with no do as string and then Plumb the type um we would then just be committed to like their only literals which is kind of fine you could just write a giant case whenn uh for a string selecting a column but you would be so yeah that's that would be the kind of that's the only like oneway door aspect of this um I mean I mean if we successfully PL the Ty wouldn't we just be able if it if it is a column type then just treat it differently I guess we could have a column type userb it's a little weird because it's just a string
right it's just that it gets used in SQL in a certain way um but we could I guess have a column type user attribute could you also in the case of the column type say as column and the the default is just to use the the type that it has and then when you want to substitute it in that way you can give it this treatment there are there are weird mustach isms with the must the thing way that mustache Works maybe there's a way to hack it but I don't think I think this thing like this either needs to be a this can't both be like a thing that produces a not an output and also something that dangles off these dot but maybe
there's a way to make it work um anyway I'll I'll drop the pr in the channel in like product Channel and folks can than next question uh so we got user attributes when are we going to introduce like environment attributes or environment variables I mean we just saw the DBT environment variables at at work like it seems would be potentially pretty handy to also introduce environment level variables it's it's possible we'd want to and maybe user attri maybe that's an issue with this top level name space but I think we'd want to like give them special Omni prefixes but put them all under the same thing just for like ease of implementation so like it's just all one bag ofri something pull out yeah so
good point yeah I I I agree Stephen that makes sense and then also seeing this I'm like oh what about you know we got mustache interpolation in liquid we had all of like conditional stuff and and that kind of stuff where are we able to accomplish that without writing a giant case statement wait is that well that's so yeah that's the mustache does not allow you to do most conditional things um which is sort of why Richard picked it and then I jumped on the bandwagon to put it in SQL because by lack of having the conditionals in mustache it makes it easy to make it work with our kind of parse squl where we like know ahead of time the structure of things you
can't have arbitrary Transformations so yeah that's the Stephen are you putting any limits on the types of mustache syntax you can use like can you use some of the the looping constructs and so forth no uh it's very limited very very limited it's just it's just a pure reference it's basically this pure reference for the user attributes um or uh then we already have mustache for the the template of filters but like so it's basically mechanism to use those two things