I am close to publishing a new CRMA dashboard that will be visible to the entire sales organization, however I need to build a security predicate first. In the past, my predecessor would created two dashboards, 1 with a predicate and 1 without which would solve the need (Managers see all data, reps only see their data). I am looking to build a better predicate that only requires 1 recipe and dashboard. My question is: can we factor in Salesforce profile types when building predicates? I would like Manager profiles to see all data in the dashboard, while Sales rep profiles should only see their own data. I know that I need to use ('User.Id' == "$User.Id") in this formula, but am hoping there is a way to say "If profile = sales rep, then use 'User.Id' == "$User.Id", and if any other profile, do not apply predicate.
Thank you in advance for any help and suggestions!
Hi @Jordan Cabral - the basic logic on how predicates words is - It takes real time values from logged in user record and compares it with your dataset.
Now, you can implement your Profile filters/Predicates with following logic:
1. Create a structure of getting all profiles with Names from digest Node (get fields - name, developer name and Id)
2. On your data source node for any object data like Account, create compute field of text outcomes (static one) to stamp Profile Names like Admin, SalesProfile - In your case you would like to create just 1 custom field for that manager profile
3. Augment 1st to this data linkage nodes by relating Developer name of custom field created by compute expression with this profile node (relationship field - developer name ) and get Id for that profile
** Reason why we are taking Ids by this route is so that you can make it scalable to get deployed to any orgs and sandboxes
4. Take this Id field of profile in register node
5. create predicate to compare this profile Id with Logged in user Profile Id , something like this ('Profile.Id' == "$User.ProfileId"), with this, Managers will have access to all records
This is tested scenario, let me know if you need more insights. Please mark my answer as best answer if it solves your issue.
#Einstein Analytics #Analytics #Einstein Analytics #Salesforce Developer #Ask An Expert