[{"data":1,"prerenderedAt":433},["ShallowReactive",2],{"footer-primary":3,"footer-secondary":93,"footer-description":119,"short-hops-dynamic-relational-interfaces":121,"short-hops-dynamic-relational-interfaces-next":167,"sales-reps":181},{"items":4},[5,29,49,69],{"id":6,"title":7,"url":8,"page":8,"children":9},"522e608a-77b0-4333-820d-d4f44be2ade1","Solutions",null,[10,15,20,25],{"id":11,"title":12,"url":8,"page":13},"fcafe85a-a798-4710-9e7a-776fe413aae5","Headless CMS",{"permalink":14},"/solutions/headless-cms",{"id":16,"title":17,"url":8,"page":18},"79972923-93cf-4777-9e32-5c9b0315fc10","Backend-as-a-Service",{"permalink":19},"/solutions/backend-as-a-service",{"id":21,"title":22,"url":8,"page":23},"0fa8d0c1-7b64-4f6f-939d-d7fdb99fc407","Product Information",{"permalink":24},"/solutions/product-information-management",{"id":26,"title":27,"url":28,"page":8},"63946d54-6052-4780-8ff4-91f5a9931dcc","100+ Things to Build","https://directus.io/blog/100-tools-apps-and-platforms-you-can-build-with-directus",{"id":30,"title":31,"url":8,"page":8,"children":32},"8ab4f9b1-f3e2-44d6-919b-011d91fe072f","Resources",[33,37,41,45],{"id":34,"title":35,"url":36,"page":8},"f951fb84-8777-4b84-9e91-996fe9d25483","Documentation","https://docs.directus.io",{"id":38,"title":39,"url":40,"page":8},"366febc7-a538-4c08-a326-e6204957f1e3","Guides","https://docs.directus.io/guides/",{"id":42,"title":43,"url":44,"page":8},"aeb9128e-1c5f-417f-863c-2449416433cd","Community","https://directus.chat",{"id":46,"title":47,"url":48,"page":8},"da1c2ed8-0a77-49b0-a903-49c56cb07de5","Release Notes","https://github.com/directus/directus/releases",{"id":50,"title":51,"url":8,"page":8,"children":52},"d61fae8c-7502-494a-822f-19ecff3d0256","Support",[53,57,61,65],{"id":54,"title":55,"url":56,"page":8},"8c43c781-7ebd-475f-a931-747e293c0a88","Issue Tracker","https://github.com/directus/directus/issues",{"id":58,"title":59,"url":60,"page":8},"d77bb78e-cf7b-4e01-932a-514414ba49d3","Feature Requests","https://github.com/directus/directus/discussions?discussions_q=is:open+sort:top",{"id":62,"title":63,"url":64,"page":8},"4346be2b-2c53-476e-b53b-becacec626a6","Community Chat","https://discord.com/channels/725371605378924594/741317677397704757",{"id":66,"title":67,"url":68,"page":8},"26c115d2-49f7-4edc-935e-d37d427fb89d","Cloud Dashboard","https://directus.cloud",{"id":70,"title":71,"url":8,"page":8,"children":72},"49141403-4f20-44ac-8453-25ace1265812","Organization",[73,78,84,88],{"id":74,"title":75,"url":76,"page":77},"1f36ea92-8a5e-47c8-914c-9822a8b9538a","About","/about",{"permalink":76},{"id":79,"title":80,"url":81,"page":82},"b84bf525-5471-4b14-a93c-225f6c386005","Careers","#",{"permalink":83},"/careers",{"id":85,"title":86,"url":87,"page":8},"86aabc3a-433d-434b-9efa-ad1d34be0a34","Brand Assets","https://drive.google.com/drive/folders/1lBOTba4RaA5ikqOn8Ewo4RYzD0XcymG9?usp=sharing",{"id":89,"title":90,"url":8,"page":91},"8d2fa1e3-198e-4405-81e1-2ceb858bc237","Contact",{"permalink":92},"/contact",{"items":94},[95,101,107,113],{"id":96,"title":97,"url":8,"page":98,"children":100},"8a1b7bfa-429d-4ffc-a650-2a5fdcf356da","Cloud Policies",{"permalink":99},"/cloud-policies",[],{"id":102,"title":103,"url":81,"page":104,"children":106},"bea848ef-828f-4306-8017-6b00ec5d4a0c","License",{"permalink":105},"/bsl",[],{"id":108,"title":109,"url":81,"page":110,"children":112},"4e914f47-4bee-42b7-b445-3119ee4196ef","Terms",{"permalink":111},"/terms",[],{"id":114,"title":115,"url":81,"page":116,"children":118},"ea69eda6-d317-4981-8421-fcabb1826bfd","Privacy",{"permalink":117},"/privacy",[],{"description":120},"\u003Cp>A composable backend to build your Headless CMS, BaaS, and more.&nbsp;\u003C/p>",{"id":122,"slug":123,"vimeo_id":124,"description":125,"tile":126,"length":127,"resources":8,"people":8,"episode_number":128,"published":129,"title":130,"video_transcript_html":131,"video_transcript_text":132,"content":133,"status":134,"episode_people":135,"recommendations":150,"season":151,"seo":166},"2d192e76-378b-4540-9d41-2506460a50af","dynamic-relational-interfaces","983671908","Learn how to create a more intuitive user experience in Directus by implementing dynamic filters on relational interfaces. This episode teaches you to set up dependent field relationships, allowing users to see only relevant options when selecting related items. ","0eb0d695-342c-447c-b406-bc7980733cae",4,5,"2024-07-26","Dynamic Relational Interfaces","\u003Cp>Speaker 0: Welcome back to another episode of Short Hops. I'm your host Brian Gillespie. And in this episode, I'm gonna give you one of the coolest tips and tricks that I've probably ever shared here on Short Ops. So stick with me on this one. It's really cool.\u003C/p>\u003Cp>Alright. So what are we focused on today? We're going to build a better user experience using filters on our relational interfaces. That is a mouthful, kind of underwhelming title. But let's dive into an example project and I'll show you what we've got going on.\u003C/p>\u003Cp>So this is a sample Directus instance. This is my Agency OS project that we put out under the Directus Labs organization. Be sure to check that out. But I wanna show you the scenario. So I'm creating a project in here, and we've got an organization, and we could add multiple contacts to this.\u003C/p>\u003Cp>So a a project belongs to an organization. Let's go with Tesla, in this case, pretty ambiguous name. And then I want to add an existing contact to this. But you could see here, here's my problem. If I take a look, I get all the contacts for this.\u003C/p>\u003Cp>So, you know, I'm only wanting to be able to select contacts that are at Tesla. So this is kind of a dependency here. How do we manage something like this? So I'm just going to open the settings, we're going to go into our data model. I'm going to look for the projects collection.\u003C/p>\u003Cp>And here inside organization, we've got contacts right beside it. What I'm looking for, you know, we could see the relationship tab and how all these things come together. But when I go into the interface, and this is a mini to mini collection or relationship, so you'll have to be mindful of how you've got your relationship set up. But if I want to set that up dependent upon a field that we already have, I could do something like this. Down here in my filter, you know, I could go in and and like hard code a value of, you know, show me all the contacts where the name contains Ashley.\u003C/p>\u003Cp>But we want this to be dynamic, right, so I'm gonna drill into our organizations. This is a many to many relationship. And I'm gonna say organizations dot id equals, and I could do this. So I'm gonna do mustache brackets here, and I'm gonna do organization, which is the name of that other field inside our data model. Alright.\u003C/p>\u003Cp>Great. So let's take a look at this and we'll go back, we'll create a new project. Right now if I click add existing, no contacts show up. How come? Right?\u003C/p>\u003Cp>So what I could do here, we'll say Directus test. That's the company we wanna do this project for. And now I only see the contacts who are part of that organization. Right? Likewise, if I change this to Tesla, I open it up and I see I've got Elon Dusk here as the only option to select.\u003C/p>\u003Cp>So that's it. Take a look at the filter on any of the relational interfaces that you've set up, this is a a nice little technique to use in certain scenarios like this one. That's it for this episode. Stay tuned for the next one.\u003C/p>","Welcome back to another episode of Short Hops. I'm your host Brian Gillespie. And in this episode, I'm gonna give you one of the coolest tips and tricks that I've probably ever shared here on Short Ops. So stick with me on this one. It's really cool. Alright. So what are we focused on today? We're going to build a better user experience using filters on our relational interfaces. That is a mouthful, kind of underwhelming title. But let's dive into an example project and I'll show you what we've got going on. So this is a sample Directus instance. This is my Agency OS project that we put out under the Directus Labs organization. Be sure to check that out. But I wanna show you the scenario. So I'm creating a project in here, and we've got an organization, and we could add multiple contacts to this. So a a project belongs to an organization. Let's go with Tesla, in this case, pretty ambiguous name. And then I want to add an existing contact to this. But you could see here, here's my problem. If I take a look, I get all the contacts for this. So, you know, I'm only wanting to be able to select contacts that are at Tesla. So this is kind of a dependency here. How do we manage something like this? So I'm just going to open the settings, we're going to go into our data model. I'm going to look for the projects collection. And here inside organization, we've got contacts right beside it. What I'm looking for, you know, we could see the relationship tab and how all these things come together. But when I go into the interface, and this is a mini to mini collection or relationship, so you'll have to be mindful of how you've got your relationship set up. But if I want to set that up dependent upon a field that we already have, I could do something like this. Down here in my filter, you know, I could go in and and like hard code a value of, you know, show me all the contacts where the name contains Ashley. But we want this to be dynamic, right, so I'm gonna drill into our organizations. This is a many to many relationship. And I'm gonna say organizations dot id equals, and I could do this. So I'm gonna do mustache brackets here, and I'm gonna do organization, which is the name of that other field inside our data model. Alright. Great. So let's take a look at this and we'll go back, we'll create a new project. Right now if I click add existing, no contacts show up. How come? Right? So what I could do here, we'll say Directus test. That's the company we wanna do this project for. And now I only see the contacts who are part of that organization. Right? Likewise, if I change this to Tesla, I open it up and I see I've got Elon Dusk here as the only option to select. So that's it. Take a look at the filter on any of the relational interfaces that you've set up, this is a a nice little technique to use in certain scenarios like this one. That's it for this episode. Stay tuned for the next one.","\u003Cp>In this episode of Short Hops, host Bryant Gillespie shares an invaluable tip for improving the user experience in Directus projects. Learn how to implement dynamic filters on relational interfaces, creating more intuitive and efficient data entry processes.\u003C/p>\n\u003Cp>What you'll learn:\u003C/p>\n\u003Cul>\n\u003Cli>Understanding the challenge of managing related data in complex structures\u003C/li>\n\u003Cli>How to set up dependent field relationships in Directus\u003C/li>\n\u003Cli>Implementing dynamic filters on many-to-many relationships\u003C/li>\n\u003Cli>Using mustache syntax to create context-aware filters\u003C/li>\n\u003Cli>Practical demonstration using a real-world project management scenario\u003C/li>\n\u003C/ul>","published",[136],{"people_id":137},{"id":138,"first_name":139,"last_name":140,"avatar":141,"bio":142,"links":143},"791e1503-1d88-463d-9347-0b9192933576","Bryant","Gillespie","9013afc8-e8d7-4182-9b18-44db08117bb9","Developer Advocate at Directus",[144,147],{"url":145,"service":146},"https://directus.io/team/bryant-gillespie","website",{"service":148,"url":149},"github","https://github.com/bryantgillespie",[],{"id":152,"number":153,"year":154,"episodes":155,"show":163},"a1886f5f-e5c4-4dd2-ac8a-d2e7c176f813",2,"2024",[156,157,158,159,122,160,161,162],"e82ffa88-91c1-4605-aefa-67bb8e20a9ed","1fb83779-28e9-4523-bcbc-57065d7177a1","f711e94f-14c1-48dd-b00c-70a340351412","fcb6f3f2-d6f3-4905-a3d9-b44aed7bb25c","cc653542-7721-4b37-8978-60fee90081dc","0bfed0fe-2c73-4528-8a6a-d3b39b4c0528","0cbf2b23-545e-4ea7-ae45-47707292caec",{"title":164,"tile":165},"Short Hops","2166990a-8dbf-4956-8b25-11b72ad203d5",{"title":8,"meta_description":8},{"id":160,"slug":168,"season":152,"vimeo_id":169,"description":170,"tile":171,"length":128,"resources":8,"people":8,"episode_number":172,"published":129,"title":173,"video_transcript_html":174,"video_transcript_text":175,"content":176,"seo":177,"status":134,"episode_people":178,"recommendations":180},"dynamic-variables","983671644","Learn to use dynamic variables like $CURRENT_USER, $CURRENT_ROLE, and $NOW to create personalized views and time-based queries both in the app interface and API calls. ","6eee710c-cce7-4302-889b-841998b61be1",6,"Dynamic Variables","\u003Cp>Speaker 0: Alright. Welcome back to another episode of Short Hops. I'm your host, Brian Gillespie. In this episode, we are talking about your friends who make filtering easier, dynamic variables. Dynamic variables, you can use these in any API calls when you are doing some filtering.\u003C/p>\u003Cp>You can also use these inside the app. And I'll show you a couple of quick use cases for them. But we'll just run through the most popular ones. These are the main ones. We have dollar sign current underscore user.\u003C/p>\u003Cp>That will give you the current ID of a particular logged in user. Current role will give you the current role ID of a logged in user, of the current logged in user. And then we have dollar sign now which will give you the current timestamp and you can do adjustments with this as well like now minus 1 year, now plus 2 hours. And I'll I'll show you how to get the most out of these in the application here. Alright, so let's take a look at a specific scenario.\u003C/p>\u003Cp>I'm inside a sample app. I've got a contacts table here. Some of these would be assigned to me, some of them would not be. But if I take a look at it, just a a standard kind of CRM format. So now if I wanted to take a look at all of my contacts, and maybe what I want to do is put a bookmark in that every user has access to, a global bookmark.\u003C/p>\u003Cp>But it's dynamic in that when they click on it, it shows their specific contacts. So the bookmark is is globally available, but it is filtered based on the current user. So how can we do something like that? Right? I can go in and I'm gonna set a filter here, let's say user created equals dollar sign underscore current user.\u003C/p>\u003Cp>And now, I get a list of my specific contacts or the ones that I created. Right? You know, I could also, you know, have the owner of my organization as well. So if the owner of the organization equals current user, that is my list. Right?\u003C/p>\u003Cp>And now I can go in and actually bookmark this and I may call it something like my contacts, because we can make this globally available. Great. So that is one way to use this. Let's take the scenario where I want to, you know, show me all the posts that have been published within the last month. Right, so again, I can use those dynamic variables to make filtering easier because I, you know, I don't wanna do the math and figure out what it was a month ago.\u003C/p>\u003Cp>So I'm just gonna go in, date published is greater than and we'll do dollar sign now minus 1 month. And boom we could see that. And again, these same filters you can use within the API as well. So if I just pull up just a little API tool called Bruno that I've been using. And we are calling these posts.\u003C/p>\u003Cp>So if we just get the post resource, we could see we're getting all of our posts here. This is just items slash posts. Now if I add a param for the date published, and let's do gt or underscore gt, which is greater than. And we'll do that dollar sign now. We'll do that same kind of query that we used.\u003C/p>\u003Cp>1 month. And here you could see I'm only getting like 1 or 2 posts. Or if I wanted to see everything that's published within the last day, boom. So that's how this works. That is dynamic variables.\u003C/p>\u003Cp>A lot you can do with these. So make sure you check them out. Read up on the documentation. And we'll see you in the next episode.\u003C/p>","Alright. Welcome back to another episode of Short Hops. I'm your host, Brian Gillespie. In this episode, we are talking about your friends who make filtering easier, dynamic variables. Dynamic variables, you can use these in any API calls when you are doing some filtering. You can also use these inside the app. And I'll show you a couple of quick use cases for them. But we'll just run through the most popular ones. These are the main ones. We have dollar sign current underscore user. That will give you the current ID of a particular logged in user. Current role will give you the current role ID of a logged in user, of the current logged in user. And then we have dollar sign now which will give you the current timestamp and you can do adjustments with this as well like now minus 1 year, now plus 2 hours. And I'll I'll show you how to get the most out of these in the application here. Alright, so let's take a look at a specific scenario. I'm inside a sample app. I've got a contacts table here. Some of these would be assigned to me, some of them would not be. But if I take a look at it, just a a standard kind of CRM format. So now if I wanted to take a look at all of my contacts, and maybe what I want to do is put a bookmark in that every user has access to, a global bookmark. But it's dynamic in that when they click on it, it shows their specific contacts. So the bookmark is is globally available, but it is filtered based on the current user. So how can we do something like that? Right? I can go in and I'm gonna set a filter here, let's say user created equals dollar sign underscore current user. And now, I get a list of my specific contacts or the ones that I created. Right? You know, I could also, you know, have the owner of my organization as well. So if the owner of the organization equals current user, that is my list. Right? And now I can go in and actually bookmark this and I may call it something like my contacts, because we can make this globally available. Great. So that is one way to use this. Let's take the scenario where I want to, you know, show me all the posts that have been published within the last month. Right, so again, I can use those dynamic variables to make filtering easier because I, you know, I don't wanna do the math and figure out what it was a month ago. So I'm just gonna go in, date published is greater than and we'll do dollar sign now minus 1 month. And boom we could see that. And again, these same filters you can use within the API as well. So if I just pull up just a little API tool called Bruno that I've been using. And we are calling these posts. So if we just get the post resource, we could see we're getting all of our posts here. This is just items slash posts. Now if I add a param for the date published, and let's do gt or underscore gt, which is greater than. And we'll do that dollar sign now. We'll do that same kind of query that we used. 1 month. And here you could see I'm only getting like 1 or 2 posts. Or if I wanted to see everything that's published within the last day, boom. So that's how this works. That is dynamic variables. A lot you can do with these. So make sure you check them out. Read up on the documentation. And we'll see you in the next episode.","\u003Cp>In this episode of Short Hops, host Bryant Gillespie introduces you to the power of dynamic variables in Directus. Learn how these versatile tools can significantly enhance your filtering capabilities, allowing you to create more personalized and time-sensitive data views with ease.\u003C/p>\n\u003Cp>What you'll learn:\u003C/p>\n\u003Cul>\n\u003Cli>Understanding the concept and benefits of dynamic variables in Directus\u003C/li>\n\u003Cli>Overview of key dynamic variables: $CURRENT_USER, $CURRENT_ROLE, and $NOW\u003C/li>\n\u003Cli>Using dynamic variables in the Directus app interface\u003C/li>\n\u003Cli>Implementing dynamic variables in API calls\u003C/li>\n\u003Cli>Creating user-specific views and global bookmarks with personalized results\u003C/li>\n\u003Cli>Utilizing time-based queries for content management\u003C/li>\n\u003C/ul>","7c0faac8-c4a5-42fe-a6a8-5199de342e6c",[179],"59719367-7875-4483-a727-162fd24e9064",[],{"reps":182},[183,239],{"name":184,"sdr":8,"link":185,"countries":186,"states":188},"John Daniels","https://meet.directus.io/meetings/john2144/john-contact-form-meeting",[187],"United States",[189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238],"Michigan","Indiana","Ohio","West Virginia","Kentucky","Virginia","Tennessee","North Carolina","South Carolina","Georgia","Florida","Alabama","Mississippi","New York","MI","IN","OH","WV","KY","VA","TN","NC","SC","GA","FL","AL","MS","NY","Connecticut","CT","Delaware","DE","Maine","ME","Maryland","MD","Massachusetts","MA","New Hampshire","NH","New Jersey","NJ","Pennsylvania","PA","Rhode Island","RI","Vermont","VT","Washington DC","DC",{"name":240,"link":241,"countries":242},"Michelle Riber","https://meetings.hubspot.com/mriber",[243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,220,431,432],"Albania","ALB","Algeria","DZA","Andorra","AND","Angola","AGO","Austria","AUT","Belgium","BEL","Benin","BEN","Bosnia and Herzegovina","BIH","Botswana","BWA","Bulgaria","BGR","Burkina Faso","BFA","Burundi","BDI","Cameroon","CMR","Cape Verde","CPV","Central African Republic","CAF","Chad","TCD","Comoros","COM","Côte d'Ivoire","CIV","Croatia","HRV","Czech Republic","CZE","Democratic Republic of Congo","COD","Denmark","DNK","Djibouti","DJI","Egypt","EGY","Equatorial Guinea","GNQ","Eritrea","ERI","Estonia","EST","Eswatini","SWZ","Ethiopia","ETH","Finland","FIN","France","FRA","Gabon","GAB","Gambia","GMB","Ghana","GHA","Greece","GRC","Guinea","GIN","Guinea-Bissau","GNB","Hungary","HUN","Iceland","ISL","Ireland","IRL","Italy","ITA","Kenya","KEN","Latvia","LVA","Lesotho","LSO","Liberia","LBR","Libya","LBY","Liechtenstein","LIE","Lithuania","LTU","Luxembourg","LUX","Madagascar","MDG","Malawi","MWI","Mali","MLI","Malta","MLT","Mauritania","MRT","Mauritius","MUS","Moldova","MDA","Monaco","MCO","Montenegro","MNE","Morocco","MAR","Mozambique","MOZ","Namibia","NAM","Niger","NER","Nigeria","NGA","North Macedonia","MKD","Norway","NOR","Poland","POL","Portugal","PRT","Republic of Congo","COG","Romania","ROU","Rwanda","RWA","San Marino","SMR","São Tomé and Príncipe","STP","Senegal","SEN","Serbia","SRB","Seychelles","SYC","Sierra Leone","SLE","Slovakia","SVK","Slovenia","SVN","Somalia","SOM","South Africa","ZAF","South Sudan","SSD","Spain","ESP","Sudan","SDN","Sweden","SWE","Tanzania","TZA","Togo","TGO","Tunisia","TUN","Uganda","UGA","United Kingdom","GBR","Vatican City","VAT","Zambia","ZMB","Zimbabwe","ZWE","UK","Germany","Netherlands","Switzerland","CH","NL",1773850442966]