Object API Name in Salesforce Lightning Web Component
Jun 28, 2026
Blog Post:
https://www.infallibletechie.com/2026/06/object-api-name-in-salesforce-lightning-web-component.html
Show More Show Less View Video Transcript
0:08
Hello everyone. In this video, we are
0:11
going to see how to get the object API
0:15
name in Salesforce a lightning web
0:17
component without using Apex.
0:23
In order to add a lightning component
0:28
in the Salesforce lightning record page,
0:31
then the target uh in the lightning web
0:34
component should be lightning
0:38
record page.
0:43
So here I'm using lightning_record
0:46
page so that this lightning web
0:48
component can be added in the lightning
0:50
record page.
0:53
If you have an use case where you wanted
0:56
to find the object API name
0:59
then you can make use of
1:02
at API object API name
1:06
similar to at API at record id uh using
1:10
which we will be able to get the ID of
1:12
the record
1:14
using at object API name we will be able
1:17
to get the object API name
1:21
let's see
1:23
demo here. So this is my custom object.
1:27
I'm able to see the object name is
1:30
member.
1:32
This is a case record. I can see the
1:34
object name as case. This is an account
1:37
record. The same component is added
1:40
in the lightning record page of the
1:42
account. I'm able to see the object name
1:44
as account. In order to achieve it,
1:50
I am making use of
1:56
at API
1:58
object API name. Here a and n should be
2:03
in upper case. The rest of the
2:05
characters should be in lower case.
2:10
In order to just get the label, I am
2:13
making use of uh replacing double
2:16
underscore C with
2:19
um null value or blank. And again I'm
2:23
replacing underscore with a space.
2:37
So in order to find the API name when
2:42
using lightning_record
2:44
page make use of at API object API name
2:50
property.
2:58
I hope it was helpful.
3:06
Please check the video description. In
3:09
the video description, I have shared my
3:10
blog post. From the blog post, you
3:12
should be able to get the sample
3:14
lightning web component code which was
3:17
referenced in this video.
3:26
Thank you for watching.
#Internet Software
#Science
