I want to have a list view of contact records to show on community based on the logged in user on community

I tried the list view filters but there is no dynamic option.

I want something like where account Id equals currentUser.accountID in the list view filter

1 Answer 1

  • Create a formula field on User called Account_Id__c. It is defined as Contact.AccountId and is a field of Text type.

  • Create a formula field on the Contact with name Is_My_Contact__c and define it to be


with formula

$User.Account_Id__c = AccountId /* is user's account same as contact's account */

Then change your listview filter to be simply Is_My_Contact__c = true

N.B. not tested; You may need to use CASESAFEID to ensure you are always comparing 18 character Ids

This gets around the issue you mentioned in your comment about $User.Contact.Account.Id converting to $User.Id after saving the formula

  • When I enter the formula and hit save and go back again and click edit on the field the formula becomes $User.Id = AccountId. Why is this happening?
    – Anwar
    Aug 7, 2022 at 17:25
  • I edited my answer @Anwar
    – cropredy
    Aug 8, 2022 at 3:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .