Component Not Showing Data

Quick solutions when your Avonni App Builder Component appears on the page but displays no records or shows "No items to display."


Quick Diagnostic Checklist

Before diving into detailed solutions, quickly verify:

If any of these fail, jump to the relevant section below.


Invalid Filter Syntax

Symptom

Component appears but shows no data, even though records exist that should match the filter.

Common Mistakes

1. Double Equals Instead of Single

❌ Wrong:

Status == 'Active'

✅ Correct:

Status = 'Active'

Why: SOQL uses single = for equality comparisons, not double == like JavaScript.


2. Invalid Operators

❌ Wrong:

Name CONTAINS 'Acme'

✅ Correct:

Name LIKE '%Acme%'

Why: SOQL uses LIKE with wildcards, not CONTAINS.


3. Missing Quotes Around Text Values

❌ Wrong:

Status = Active

✅ Correct:

Status = 'Active'

Why: Text values in SOQL must be wrapped in single quotes.


4. Quotes Around Numbers

❌ Wrong:

Amount = '50000'

✅ Correct:

Amount = 50000

Why: Number fields should not be quoted in SOQL filters.


How to Fix

Step 1: Test in Developer Console

Before fixing the component, verify your filter logic works:

  1. Open Developer Console (Setup > Developer Console)

  2. Click Query Editor tab

  3. Test your filter as a SOQL query:

   SELECT Id, Name FROM Opportunity WHERE Status = 'Active'
  1. If it returns results, the syntax is valid

  2. If it errors, review the error message for guidance

Step 2: Update Component Filter

Copy the working WHERE clause from Developer Console directly into your component's Filter property.

Step 3: Verify Results

Save the Lightning page and test with actual data.

Need more help with filter syntax? See Component Properties Reference for detailed SOQL filter patterns.


Field API Name Issues

Symptom

Component shows no data or displays errors about invalid fields.

Common Mistakes

1. Using Label Instead of API Name

❌ Wrong:

Filter: Stage = 'Closed Won'
Columns: Name,Stage,Close Date

✅ Correct:

Filter: StageName = 'Closed Won'
Columns: Name,StageName,CloseDate

Why: You must use the field's API name, not its display label.


2. Case Sensitivity

❌ Wrong:

Columns: name,email,phone

✅ Correct:

Columns: Name,Email,Phone

Why: Field API names are case-sensitive and typically use PascalCase.


3. Custom Field Suffix Missing

❌ Wrong:

Filter: Region = 'West'

✅ Correct:

Filter: Region__c = 'West'

Why: Custom fields require the __c suffix.


4. Incorrect Relationship Syntax

❌ Wrong:

Filter: Account_Name = 'Acme Corp'

✅ Correct:

Filter: Account.Name = 'Acme Corp'

Why: Relationship fields use dot notation, not underscores.


How to Find Correct Field API Names

Method 1: Object Manager (Most Reliable)

  1. Setup > Object Manager

  2. Select your object (e.g., Opportunity)

  3. Click Fields & Relationships

  4. Find your field and copy the API Name exactly

  5. For custom fields, include the __c suffix

Method 2: Field Inspector

  1. Go to any record page for the object

  2. Click gear icon > Edit Page

  3. In Lightning App Builder, hover over any field

  4. API name appears in tooltip or field properties

Pro Tip: Always copy/paste field API names rather than typing them to avoid spelling errors.


Object and Field Permissions

Symptom

Component shows no data for some users but works fine for administrators.

Understanding Permission Layers

Salesforce security has multiple layers that all must allow access:

  1. Object-Level Read Permission - User must have Read access to the object

  2. Field-Level Security (FLS) - User must have Read access to each field

  3. Record-Level Sharing - User must have access to specific records (covered in next section)


Check Object Permissions

For Profiles:

  1. Setup > Profiles

  2. Select user's profile

  3. Click Object Settings

  4. Find the object (e.g., Opportunity)

  5. Verify Read permission is checked

For Permission Sets:

  1. Setup > Permission Sets

  2. Select relevant permission set

  3. Click Object Settings

  4. Find the object

  5. Verify Read permission is checked

If missing: Enable Read permission and test again.


Check Field-Level Security

For Specific Fields:

  1. Setup > Object Manager

  2. Select your object

  3. Click Fields & Relationships

  4. Click the field name

  5. Click "Set Field-Level Security"

  6. Find user's profile

  7. Verify Visible is checked

Quick Test: Log in as the affected user and try to view the field on a record detail page. If you can't see it there, the component won't show it either.


Common Permission Scenarios

Scenario 1: Admins See Data, Standard Users Don't

  • Cause: Standard User profile lacks object Read permission

  • Solution: Grant Read permission to Standard User profile or create custom permission set

Scenario 2: Some Fields Missing from Component

  • Cause: Field-level security restricts those fields

  • Solution: Grant field Read access to user's profile or use different fields

Scenario 3: Works in Sandbox, Not Production

  • Cause: Profile permissions differ between environments

  • Solution: Verify and sync permission settings across environments


Sharing Rules and Record Access

Symptom

Component shows fewer records than expected, or different users see different amounts of data.

Understanding Sharing Rules

Even with object and field permissions, users must have record-level access to see specific records. Salesforce sharing rules control this access.

Key Concept: The component filter is applied AFTER sharing rules. Users only see records they can access, even if those records match the filter.


Check Organization-Wide Defaults (OWD)

Steps:

  1. Setup > Sharing Settings

  2. Find your object in the list

  3. Check the "Default Internal Access" column

Common Issue: OWD is set to Private, but users need to see records they don't own.


Check Sharing Rules

Steps:

  1. Setup > Sharing Settings

  2. Scroll to your object's Sharing Rules section

  3. Review existing rules

Common Sharing Rules:

  • Role-based: Share records with users in specific roles

  • Criteria-based: Share records matching criteria (e.g., all accounts in "West" region)

  • Owner-based: Share records based on owner's role or territory

If users should see records but don't: Create or modify sharing rules to grant access.


Check Manual Sharing

Sometimes records are manually shared with specific users:

Steps:

  1. Go to a record the user should see

  2. Click Sharing button

  3. Check who has access

  4. Manually add the user if needed


Test as the User

Best Practice: Always test components by logging in as the actual user experiencing the issue.

Steps:

  1. Setup > Users

  2. Find the user

  3. Click "Login" (if you have that permission)

  4. Navigate to the Lightning page with the component

  5. Verify what data appears

What to look for:

  • Do any records appear?

  • Are fewer records shown than expected?

  • Do fields show "Insufficient Access" or appear blank?

This reveals exactly what the user experiences and helps identify permission gaps.

Last updated

Was this helpful?