Uncategorized

– And hello, hello everyone and welcome to this new Trailhead Live episode My name is Philippe Ozil I’m a developer evangelist at Salesforce and today I’m gonna be talking to you about the user interface API and how you can write less Apex by using it and aligning with components Before I jump into the presentation, I’m gonna give you the traditional forward-looking statement We are a publicly traded company, so please make your purchasing decisions based on what is commercially available in the product That being said, here is our agenda for today I’m gonna start with a refresher of what is user interface API and what are the different ways to access it And I’ll be spending more time in our presentation on how we can use user interface API with Lightning Web Components So, let’s get started I’m gonna talk about what is the user interface API So, this is an API that is used to create and render the Salesforce UI, whether it is a mobile or desktop and where also you’re creating custom applications on first party frameworks So for example, you could create a react application and you could use the Salesforce user interface API to help you render your custom application in the same way we use it for the Salesforce UI What is interesting with this API is that it is the only API that aggregates Data and Metadata together So, this is pretty powerful because you have, as you may already know a couple of APIs, which are good for getting data and some others which are more focused on Metadata, but they’re generally not mixed together So, this means there’ll be more API calls to get the whole picture for an object and records So, I’ll give you some details about that But the idea here is that it’s meant to be really optimized to limit the number of requests that are being made to render a user interface It also works with multiple form factors I mentioned earlier, that we have mobile and desktop, but you could also create your own form factors This API is available with REST and there are bunch of top level endpoints that you can access For these different resources, you have multiple endpoints so you can do quite a few things with those The first resource that you have is records So, this lists record data, but also list the user interface associated with records So for example, the record pages You also have actions, so this is things like for quick actions or global actions You have favorites, which I think is pretty obvious for this It’s a way to put favorites physical and the list views, all that stuff List views themselves, so list views is a collection of the different lists that they’re available on the platform, the ones that are being created by admins, but also the ones that are saved by users So, it contains information about these displayed columns, the different filters that you can configure for list views, these kinds of stuff And applications So, application contains the list of tabs that there are an application, type of profiles that have access to these applications and of course the positions also in the application launcher And finally, some information about the active theme for the UI So, all of that is generally used in the lining user experience, but this can be also used in your own applications if you decide to use a user interface API Let’s take an example of one of these endpoints And here, we’re gonna look at the, I think the one you use the most maybe without knowing it, the record UI input So, what I wrote here in the slide is the the end of the path to get to call this particular endpoint It’s under stash, ui-api/record-ui And then an idea of a record Now, this particular record here is a contact and then I’m gonna run this particular request

But the idea here is that by calling this particular endpoint I get REST verb, we get a lot of information So, we get information about security because this request will run for all the different security checks that are required so that you have only access to information, but you are allowed to see it It’ll check for field-level security It will hide the field which don’t have access to it It’ll make sure it was sharing is okay and the permission sets are okay It will get the record data, I think that’s the minimum we can do of course, with all the fields that you have access to But it also gets more information about the object metadata So for example, if a particular field is of type pick lists, you’ll get the values, the possible values for the pick list So, not only you get the information about the record, but you can also information about the object itself So, that’s pretty powerful You also get information about what is localized The UI API, like the other APIs require that you’re authenticated And the user that calls the UI API has some preferences So, we know the language of user that is calling the UI API and we can render the UI API with the right localization So, you’ll see we’re able to retrieve field-level in the right language for a particular API call And of course, some information about the theme For example, the density of the theme, whether the user has selected a compact density or be a comfortable density Finally, we have information about layout So, if there are more than one layout, you also get information about the layouts The way the fields the positioned, the columns, the sections, things like that So, this is the theory Now, let’s see that in practice So, I’m gonna go to a demo here, our first demo today and I’m gonna use something called Postman Postman is a REST client, HTP client, sorry, that lets you run HTP calls to test and discover APIs In the configuration of Postman here that I have, I’ve imported the Salesforce API’s collection This is an open-source project that I created with a colleague of mine named Sebastian Kolarov And the idea behind this product is that we created a whole lot of collection of different requests for various Salesforce API And here you can see we have about 10 different API that we can access here And the idea is that for those different API we’ve prepared request templates that lets you use those different APIs So, let’s actually use those and we’re gonna go in the UI API here and we’re gonna call it some of the UI API endpoints Before I call the UI API endpoint, we need first to authenticate So, I’m gonna go in auth and I’m gonna perform some authentication The easiest way to authenticate here is by using the SOAP login Now, with my SOAP login here, I have already pre-configured my different credentials So, I already have entered my username, my password and everything I will not show it to you of course, for security reasons, but I’ve prepared my authentication And by sending specific variables in my environment Now, I’m gonna click send, this will send the request and here it will get me an access token You can see what the requests by looking at the HTP status here, which is okay It means that I’m authenticated Now, that I’m authenticated, I can call any of these templates, our end points for these different APIs Again, we’re looking at the UI API, we’re gonna go on record and we’re gonna take, for example, the first endpoint here, get record data and object Metadata This is the same endpoint that I’ve been showing to you in the slides So, except this time we get the full URL Here I have parameters here that are dynamically replaced with my org domain, but this is the full path with the version And this is a contact ID, I think contact on our account Let’s see, actually So, all I need to do is do this and also need to set up a header with the access token because the API is authenticated So, when I’ve run the SOAP login earlier, this has automatically retrieved for me an access token that I’m gonna be passing in the headers of this particular GET call Let’s see, I’m gonna send my request And normally if everything goes right, I’m gonna get a large JSON object, here we go So, this one took a bit of time

I have pretty poor connection, but anyway What is inside this request is pretty amazing So, I’m gonna collapse all the fields so that we can see what is in there So, you can see already the size of the response This is a JSON object that has been returned here, it’s pretty formatted of course the output is much more condensed, but you can imagine the amount of data we have here, we have more than 10,000 lines when it’s formatted in a pretty output So, what do we have here? What is all of this information? So, I’m not gonna go in order so that I keep things clear for you I’m gonna start with layouts Layouts is pretty obvious If I go in layout, we’ll see it was an account object And here we have information about the full layout for my account object In the view mode, we can have also the different modes In this location I only have a view mode Scrolling down there, we see multiple sections, whether they can be collapsed or not Number of columns and the different fields if we scroll down there, like owner ID, rating, et cetera So, these are all the fields with the right label names localized for my user Of course, this user is using English so you won’t notice But if I was accessing this API for a user that is configured, for example, in French, you will see French labels in there in the layout Now, not only that, but we also have the layout user state The API knows who I am as a user So, it knows if have interacted previously with the layout So for example, maybe I could have collapsed certain section of the layout and I would be able to see this information here if I collapsed one of this sections For example, the general information or the address information, if I collapse those sections, I can total all these fields there So, that’s minor detail, but this is just to show you how detailed information is Now, more interesting, later on the requests we have also this key called object information On top of the layout, you also get the full information about the account object So, you’ll see the relationships with the other objects, you also see the different fields down to all the details So, when you create the object in the Schema Explorer, you can see all the field information here, the label, the land for a very require or not Whether we have formulas running on them, all of that So, it’s very, very detailed You have all the information that is being run in the object manager And finally, we have information about the current record So this is again, the idea of the record we’ve selected in the request here and we can see all the field values for or a particular object So, I’m not going to scroll on for this because this is just the sample record Another thing is filled here, but you can see all the different fields here and versus sheeted values Now, that’s a lot of information for a single API code and the reason why it vary so much information grouped into a single call is that this lets us display a record page with a single API call Everything we need to render the record page is in this response here From the layout, to the object information, to even the record data So, that it is very, very powerful It does also a lot of things for us So, I mentioned before it’s running security checks, aggregating all of his data, the theme, localization, everything that you could do with other API, of course, but if you had to do all of that with other API, it would probably do tens of different requests and that would be very slow to display It would also take a lot of time to compile all the results and render the page the way it is supposed to render So, that is the essence of the user interface API How are we using it in lightning experience? So, this is really the foundation of user experience And I’m gonna show you a bit how it is positioned in the architecture of learning user experience So, let’s rewind a bit and let’s start really from most create reports, the things that you manipulate in your day to day work On top of a learning experience, you have based components So, radio buttons, drop downs, input fields That’s really what is the fire grain components, but some of these components can be grouped

in so-called experience components So, think about what is exposed to the lightning app builder So, some of them of course can be customized by you, but some of them also are shipped by default with the products So, think about list views, a related list, chatter feed, these are all experienced components And these experience components are always using the user interface API to render information That is really important to understand Now these different components, whether they’re base components or even your own custom components are built on the foundation of the application layer The application layer lets you create custom apps and extend the default apps This includes the Lightning Web Components framework It also includes SLDS, Salesforce Design System, things like locker, et cetera Now, this application layer uses certain services behind the scene, among them there’s lightning data service, which is our intelligent caching mechanism This is a way to share information across different components that are sending on a page So, each component is almost independent, but it relies on the lightning data service to share caching information with the other components that are being rendered on the page And the lightning data service itself is connected to UI API So, this way we can intelligently cache information and load exactly what we need to render our page Finally, really at the bottom, we have the core platform, the shared services So, think about it like the schedule draws, the persistence layer, all that, which is not something you would directly access, you would access it through Apex, for example through the upper layers So, this is how UI API works and the UI API works by directly communicating with the core platform, but simplifying all the operations that we need to perform manually otherwise in the application layer So, that’s kind of a shortcut for us to get the right amount of familiar information to render our user interface Now, what I’ve talked about the user interface API in general, we’re gonna now focus on how the user API works with Lightning Web Components So, let’s go for the second part of this presentation with some more demos and some Lightning Web Components There are essentially two ways to use the user interface API with Lightning Web Components Either using base components or using the UI API wire adapters and functions Option one is really the same as you would have with Aura There are a set of base components which are available out of the box to access the user interface API These are generally very simple to use and they produce a user interface, they’re visual components You don’t directly use the API because you don’t have access to the data itself, but you get something that is rendered that is using the API And I’m gonna explain, of course, what these components are We’re gonna see some examples, but this first level of example, of this first option using base component is a really a pure markup implementation You only write XML or actually HTML, I should say There is no JavaScript and no Apex required in this particular approach So, this is simple, but it’s also not the most flexible approach But if you wanna go further, very simple that is specific to Lightning Web Components That’s the UI API wire adapters and functions This is the most flexible because you have a direct access to the UI API, but it means also that it doesn’t render any outputs It’s your job to take the data from the API and render something out of it with some of our base components or even your own custom components So, this is something that requires a lot of JavaScript learning, but it doesn’t require any Apex And this is how it’s efficient All the code is located in a component, you limit the volume of code you create Let’s see now option one more in detail Let’s talk about those base components before we look at option two So, using base components, we can render record forms with three base components And these are also available by the way in Aura These are the same components that are available in Aura Lightning Web Components We have lighting record form, lighting record view form, and lighting record edit form The first one is particular, but the two others are very similar And I’m gonna show you an example of each up next Let’s start with record form Record form is the simplest way to use the user interface API in Lightning Web Components It’s just a couple of lines, but it’s super powerful All you have to do is to pass information like a record ID and our object API name

and that’s enough to generate a form just like you would have on a regular record page Now, in this particular case, I added a few extra parameters which are optional and I specify we’re wanting to use the compact layout just to have a few fields I split that into two columns to make it more compact And I specify that I wanted to have a read only view So, there are options, you can switch to a full layout to have all the fields that have been configured by view and in a full layout You could also have only a single column You could move to the edit mode, for example These are part of the options This is really easy to do You can see with just a few lines of code, but it’s super powerful because if the administrator changes layout, your markup will not change, but the output of the code will change So, if the admin decides to add a new field to be compact layout or full layout, we could have this extra field being rendered in our custom component that uses the lightning record form Also, another interesting thing that is worth remembering is that this component, the other components, that user UI API also go through the lightning data service and we also go through security checks So, let’s say for example, that my user is not allowed to see the contact email Well, the contact email will simply be removed from this view here This will not cause any error, you won’t have to do anything as a developer to limit what the user sees It’s just something that is configured by the admin and the code remains the same for everyone So, that is really powerful Now, let’s see more advanced example here Record form it’s interesting, but it’s a bit limited because you don’t really select the fields you want to display It’s only the compact layout or the full layout You cannot say, “Okay, maybe I want an extra field or something.” You cannot do that with the record form But you have the two other based components that you can use That’s record edit form and the record view form I’m going only gonna show you one example here because the two of them are pretty similar in the way they work They’re very simple to configure The minimum is record ID and the API name And then what is interesting is that they work with sub-components And these sub-components are structured of you And in this particular case, we have selected such certain fields We’re using a combination of output fields and input fields So, the output field is showing the account ID, but this contact is linked to and the other input fields are editable and let you control or enter specific values, first name, last name and email I’ve also added lighting message, a component here which would eventually show some error messages when I’m saving and have errors And finally, I’ve also added a very simple submit button of type submit This is really important to submit this form What’s interesting with this implementation here is that I don’t have to worry about the logic to save the record I only have to do a submit click on that submit button and that’s it I have no JavaScript to write And the UI API will do the job of saving the component, making sure the field values match what is expected Run the formulas, if any and make sure it’s all valid Now, this is as you can see is a bit more flexible than the previous option because here I can select the different fields, but it’s also very interesting because I don’t have to do anything in terms of configuration So like saying, for example, if I had a field that is required, I don’t have to know about this because this is taking directly from the record and for the object information I know that last name is required because the UI API tells me that’s the last name field of this contact object is required So, it does the work of displaying it the right way Here, these are just text field But if I had, for example, a dropdown with a pick list, well, the UI API would do the job of figuring out what are the possible values for that pick list and retrieve them for me I wouldn’t have to do many different API calls to figure out what are the possible values of this particular dropdown I will just have to provide a input field with the right field name and the UI API does the job of figuring out what we need and what can be rendered So, that’s very powerful Same thing, if we have related lists, that’s an easy way to get a lookup field, that is provided natively by the platform

In this example here via account ID, that I’ve entered here is a static, it’s not good field, but if I changed that to an input field, I would have here a lookup, what would allow me to select in our accounts to link that contact to And again, the update would do the work of reattaching the contact to new account if I change the account So, that is really powerful Now, that we’ve seen really the basics here, let’s now move to something that is a bit more flexible We’re gonna go to option number two, which is specific to Lightning Web Components and which is way more powerful than just using base components We’re gonna talk about the UI API wire adapters and functions So, that is pretty powerful because here we really have access to the UI API So, we have data and metadata and we can decide to do whatever we want to display information based on that There are a total of 19 wire adapters that are grouped into three node modules that you can use in our Lightning Web Components The first one, it’s called the ui-list-apa It’s something that is still in Beta as of summer of 20 And it’s a way to retrieve information about list views I’ll show you an example of that later on, but it’s really interesting because it’s a way almost to create some sort of SOCO query behind the scene because you select filters and you get a result of the list of records And it’s pretty interesting because it’s supported very well pagination, I’ll show you that just later But also the ui-object-info-api module, which has quite a few endpoints under it Everything that has to do with the object metadata So, the field times, if for example you have pick lists, the different values of those pick lists, the different record types for a particular object, et cetera, et cetera And lastly, the ui-record-api That’s the first one we saw in Postman and that’s the way to render a particular record user interface So, let’s go now and see that in action So, I’m gonna switch now to Salesforce work here that has those different components So, here we can see the examples we had earlier in the slides The record form using the base component, the record edit form using also the base component And now we’re gonna look at those three other examples here, which are examples of how to use the UI API with Lightning Web Components The first example I have here is a very naive approach of getting a contact list with Apex So, let’s look quickly at the code here to see what is involved If I were to do that with Apex, I would need an Apex class, a controller that does SOCO query that returns the contact information So, here I only selecting the name and title, of course the ID, but I would also to take care of security So, I would have to use with security enforced I would have also to use a permission set to grant permission to this particular Aura-enabled endpoint This is something that is required as of winter 21, so we have to do it very soon You know how to grant permission to particular endpoints to users So, either you give them at the user level, but you can also give at the profile level, but you need to secure your endpoints So again, security with the permission set, the Apex class with the SOCO query with the right fields, with security enforced sorting eventually and all of that Then the Lightning Web Components goes So here, we’re looking at the contact with Apex, which is very simple It’s importing a wire adapter that is generated from my GET contact Apex method And we’re just linking that to the contact That’s really simple And the output via template is not very interesting It’s just an iteration on the contact data and just listed elements for that particular I just realized that I forgot to include the a UL tag that is above it, but anyway, HTML it’s magic It’s still works anyway So, that’s the first approach What you could do, you could write this with Apex Now, the problem is if tomorrow the business requirements change and you have to add another field or maybe change the ordering of this list Well, you have to go back to code Of course, this particular example is very simple, but if the business changes their mind,

you have to change code, that’s a strong requirement Now, if you’re using the user interface API, you can forget about this Apex controller and you can write this very differently So, I can show you very quickly the contact list with UI API There’s really no difference here It’s the same rendering, but the code here is gonna be very different The code with user interface API is gonna be different in the sense that we no longer have an Apex control instead we’re importing and then a wire adapter from the a UI API So, this one is UI list API, is getting information from list views I’m putting a reference to my contact of it, which it’s a list of contacts And then we’re calling our wire adapter here And passing a few parameters, like the object API name, which is a contact I’m selecting a list view, here, I have created custom lists view called my favorite contacts and I’m setting the page size I could do more than that I could also decide the ordering and do a couple of more things And then I just take my data and I assign it to contacts And then I do the same logic that I had before in the markup, I’m rendering the information So, it’s a bit more code here You can see where there are a few more lines in the Apex version But there is no Apex now, all the logic is here And also, I did not have to worry about the permission set to grant access at Aura-enabled endpoint This is all done by the UI API and the UI API in this case is the one that does the checks for security It’s the one that knows whether I have the right or not to access this particular list Let’s go back to the org now and let’s see what we could do now that this information is used from the UI API So again, imagine the business changes it’s mind and we now wanna see the full list Maybe you wanna see on the C level employees in our contact list here So, what could I do to change that? Well, I would simply go and access the contacts and I would go into my list view So, this is my favorite contacts, this is the list view I’ve created And here what I could do is I could change that list So, I could go in the filters, for example and I could decide to add a new filter So here, for example, well, I could link two active accounts I could use relationships to different objects I’m gonna do something very simple In my case, I’m just gonna say, I wanna filter the title starting with C for example, just to get the C level Save that and it’s gonna rerun my list filters I have CEO’s and CFO’s in my list now And if I go back now, to my example, on this contact list API, you can now see that my list has changed Here, I used a very simple example, of course, but you can imagine the power of what this represents I didn’t change the code here, but the admin can change what is rendered in this view here Now, in this case, I’ve hard coded the fields that are being displayed, but of course this is more powerful because if I were go on more advanced example, the fields that are render here are available through the UI API Are the fields that are selected in these columns So, the admin also could configure the fields without being displayed in the fields that are being returned in the endpoint, in my UI API list here So, that is very powerful So, that’s a first go It is really good because it means that the developer doesn’t need always to be in the loop when there are some customizations to be made But what we’re gonna see now, what is even more powerful is if we want to add pagination to this particular example So, I’m gonna remove my filter because we only have now our free results Let me drop my filter from my favorite contacts to get the full list back Let me save that again So, now we have the full list of our contacts and we’re gonna look at this other example here, which is by the way not refreshed Let me just refresh that There we go Now we have a full list and we have a paginated list So, let’s see what code is behind the scenes So, this is also using the UI API, but I’ve just added a pagination control here and I’ve passed some extra parameters So, this is the next component here,

the contact list paginated with UI API So, I’m gonna stick that one here and I’m gonna show you the new version So, the new version has a few more things First, we import a field from the contact to select the filtering We have a few more attributes here, page token, next page token and previous space token, which helps us to do the pagination We have some extra parameters for the wire We have included the sorting of the list So, here we’re using name field, the page size again and the page tokens The page token is very interesting because it’s an attribute that is not set by default The default is null But what are we gonna look at a page it’s gonna change and it’s gonna give us what current page we’re looking at So, as we move on page numbers, the page token will change and also the next page token and previous page token will change And that is all supplied by the user interface API So, the response of the API goes into this function list view And if we have some data, first, we have our records for the context, but we also get next page token and a previous page token This is what lets us do the pagination It gives us pointers as to how to get the previous page or the next page And when we click on the buttons to go to the next page or the previous page, we just copy with previous page token or the next page token and override the current page token Changing the page token changes the value in the wire here and cause again the wire to refresh the page And then we have just two simple galleries here that tells us whether there no previous pages or no next page That is all you have to do to implement pagination with the use interface API Now, if you’ve already done that in Apex, you know how much of a pain this can be And here we’re looking at, I would say less than 50 lines of code to have something that is dynamic, that can be sorted without any sort logic except specifying a specific field name And it also reactive to declarative changes So, that’s something very powerful and also it’s way more flexible than hearkening everything with Apex So, that is what I really wanted to show you today with how you can write less Apex by using a user interface API Now, this is just one of the different endpoints of the user interface API I’ll leave you today with a contribution that I’ve made And I think that you’ll find useful It’s called the UI API playground What I did is here in this particular project is open source on GitHub Is that I’ve collected, I’ve looked at all different endpoints on the user API endpoints and I created some examples, some playgrounds to interact with all of those endpoints So, here we can see the all different node modules that are exposed at top level And if we go down there, we have the different wire adapter of functions that are in those node modules So, let’s say we want again use GET lists UI, that’s the one we had earlier Here we can get, for example, the all account list view, pick you send And here you can see the output of the UI API calls within a Lightning Web Components All of that, the UI API playground is a Lightning Web Components So, you can explore directly of Aura JSON output here or you can go and scroll down The information is a more structured way So, that’s a good way to explore the API And it’s also a good way to understand what values you can pass through this Behind the scene is adapter wire, we’ll forget UI will be super emitters And here you also have a community link to the documentation on the systems documentation The UI API is pretty simple to understand that there are some more advanced cases Like for example, the GET record of UI we saw earlier Here we have all different parameters exposed with dropdown so you can easily understand the different values that you can use So here, for example, I could create a contact object with a full layout and I could also specify some optional fields, I’m not gonna do that But if I send that, you’ll see the information we had earlier on at the beginning of this presentation in Postman with the layout user states, layout et cetera And the record information for my contact information, et cetera, et cetera So, that’s a convenient way to explore

the user interface API and there are really some examples which are more tricky than ours Like for example, there are certain things that can be called in multiple ways The GET record endpoint is a good example You can have a specify a manually the fields you wanna retrieve or specify a combination of more than layout And with this little playground you can see easily what are the right configurations Then you also see some default values here that work out of the box, without you figuring out what you need to pass in those particular endpoints This is very interesting, especially for things like delete or create record So here, if you wanted to create a new record while you have this playground and you can create easily with the UI API a new record So, I’m not sure you were aware of that, but you don’t need to write any Apex to create a record, You can do that with the UI API And this is a function that is exposed in the UI record API module You can call that with this bit of a JSON and it will create a simple account So, let me show you If I click sent, this creates a sample account and here you can see in the response, I have all the account information here And let’s see that it really works So, I’m gonna copy this new record ID here I can load it with GET record I’m gonna get the full mode in the view, fully out in view mode And here you can see that this is our simple account that we just created It’s very empty I didn’t specify any field I just created it now And we should see sample account Here, that’s the name Sample account, that’s the one we just created But normally with that we can do other create operations We can also update the record so we could change some values here So for example, I can rename my record So, I’m gonna keep the same idea of course, but I can change the name to new name for my sample account Here, it’s modified, my account is modified And if you scroll down in the fields and if I go for the name, you’ll see that the name is new name now And finally, I can also use the delete record function here with my record ID here And I can delete my sample account Oh, little mistake Well, I’ll need to fix that, but that’s the idea here You get access to create operations without writing a single line of Apex and that is very powerful because sometimes you just need to create a sample record and it’s a waste of energy to create the whole logic in Apex to do that because it’s not something you would need to test In this particular instance, you don’t need to test the create logic You would just need to test that you are indeed calling the user interface API Now, let me show you a few more things There are also some very valuable information in the UI object in for API module Things that are very expensive to do in Apex and that require a lot of lines of code getting the object information For example, so with that endpoint here, you can get all the information for the account object You can get the different child relationships You can also get the record types There are multiple record types on this occasion here On this one they only have one, which is the default But if I had multiple record types, I could have access to all of that here Same thing for pick lists I’m pretty sure all of you have tried to root your pick list value for Apex at some point But for view UI API you don’t need that So here, for example, I can retrieve the current value for the account rating for this particular record type and all the possible values So, here you can see that I have free values, which are hot, warm and cold So, this works with any record type or any particular field And it’s just a wire adapter call to get this information So, with this little playground, you can easily see the values you need to pass You can really test them And if you’re interested in those endpoints, you can always click on documentation, navigate away and get the full documentation with some of our parameters that are not necessarily exposed So here, for example, you can see what I did earlier with another field here That’s the magic of the UI API That’s it So, now let me just finish with the slides We’ve seen examples of all of these different endpoints We’ve seen that we can use the UI API playground,

which I’m gonna share with you to try those out It’s time for me to conclude I showed you today various ways to use the user interface API We saw how we can use base components We also saw we have some even more advanced features with Lightning Web Components We can use wire adapters and functions This lets us create operation, create read update delete operations, plus also getting some things that are a trigger to get in Apex We saw the different benefits of the UI API, in particular it removes almost all the need for any custom Apex, except if you have really advanced business logic, but you generally don’t need any custom controllers at some point It’s super efficient in terms of performance because it allows you to get a lot of information with only one or two requests because it groups, again the metadata and data insight responses Also benefits from lightning data service caching, which is really powerful It has built-in security so it will check for a field level security, profile security, permission sets, sharing, et cetera for you So, you don’t have to worry about that It also allows you to not have to assign permissions for Apex endpoints or Aura-enabled endpoints And finally, I think what is most interesting part is that it allows you to have code that is upgradable or that can be changed without you as a developer going in a code So, sorry, let me rephrase that It allows you to have components which can be updated with declarative means without you having to modify code Again, if you take the example of the list view, the admin can select filters, the admin can select columns and change all of that And this can impact the rendering of your custom component without you having to modify the code So, that’s the idea here with a lot of benefits for user interface API compared to Apex I hope that I’ve convinced you to use it So, I’m gonna leave you with a few resources to get you started The first one is I think the most, I’ve just one that’s documentation We have user interface API developer guide It’s pretty large And I just wanna make one thing clear before going forward This is the full API docs and this is what is available for the REST endpoints This is not necessarily what is available only in Lightning Web Components Lightning Web Components only have access to a subset of entire UI API There are only a few things that was a phase, but it’s quite powerful already as we’ve seen You can also get your hands on the user interface API and explore it with a trial ed product called user interface API, The name is pretty obvious But it’s a good product, which lets you create a third-party application, but is independent from the Salesforce platform But does indeed retrieve information from the user UI API to create a similar experience And finally, I wanna leave you with the UI API playground It’s on my GitHub, grab it, deployed to a scratch on or push it to you maybe to your developer edition to your Sandbox and you’ll be able to access different endpoints of UI API of Lightning Web Components and export in different parameters and options It’s just like we saw earlier With that, I’d like to thank you I’m gonna take a few questions up next Thanks

You Want To Have Your Favorite Car?

We have a big list of modern & classic cars in both used and new categories.