alexed1 / LightningFlowComponents

A collection of unofficial Flow extensions that can be used to enhance Salesforce Flow and Orchestrator.
http://unofficialsf.com
Other
579 stars 575 forks source link

Datatable - Support Including fields from related object records #618

Open Garywoo opened 3 years ago

Garywoo commented 3 years ago

Hi @ericrsmith35, 

It would be very useful if we could include fields from related records as columns in a datatable. This would be handy to provide some extra context for the records displayed.

For example, when displaying a table of contacts, give users a way to include columns from the related account record, like Account.AccountNumber.

I've tried manually specifying the related record fields as column fields in the Configure Columns wizard, but this didn't work, giving me the error:

Apex Action error: Could not find the field: Account.AccountNumber on
the object Contact

I haven't figured out a workaround for this so far, without resorting to creating new formula fields on the parent object to pull in the related record fields. Any better suggestions would be welcome.

dmandan5 commented 3 years ago

Hi @ericrsmith35 are there plans to implement this? The workaround of formula fields would be fine except I've got a few long text fields that obviously can't be used in cross object formulas. Thanks!

ericrsmith35 commented 3 years ago

I may consider this in the future, but it is not on my current roadmap.

David-MyRaceDay commented 3 years ago

Another option would be to create a custom APEX type for this that is includes all the fields you need.

ericrsmith35 commented 3 years ago

@96DaveWright That is the best solution right now. I even have a blog post on how to do that here: https://ericsplayground.wordpress.com/2021/01/23/how-to-use-an-apex-defined-object-with-the-datatable-flow-component/