Add support for custom field mappings in Flow
In v4.13.14, custom field mappings were added for Apex. This same/equivalent functionality should be added for Flows to use via the Flow invocable classes.
- #655 - issue for the original field mapping enhancement request
- #664 - PR for the initial release of Apex custom field mappings
Hi @jongpie, just wanted to get an ETA for this issue. As once this is feature releases, we are going to leverage this custom mapping attributes for datadog integration.
Hi @JaskiratSinghIH - at the moment, I don't expect to work on this for at least several months. There are several challenges with making this work in Flow, including:
- How to handle Flow's lack-of-support for generic
Objectinputs/outputs - since the custom fields could be of any data type, the custom actions need to have some way to support all data types, without usingObject - How to present this functionality in Flow. I have issue #753 open as a way to possibly improve the UI overall (using custom property editors) - this would also provide a way to help with mapping of the custom fields/attributes, but it also introduces a lot more complexity for the invocable actions.
My plan is to eventually build some proof-of-concepts for some of this & try to determine a path forward. But in the meantime, there are several other enhancements/issues with a clearer path forward, so I'll be focused on other items for the next few months.
With all that said, I'd love to know more about how this will help with your integration with Datadog - several people have asked for Nebula Logger to have Datadog integration (example: issue #466 started as a request for Datadog support), and I hope to provide it in the future using OpenTelemetry (OTEL), though I have not used Datadog very much myself & there's still some more exploration that I need to do. Can you share some context on how you plan to use custom fields/attributes in your Datadog integration?
Hi @jongpie, Thanks for the quick response!!
Datadog Approach: As mentioned in #466 once the custom mapping is achieved then we can leverage the plugin approach -
- Creating Plugin Class For Datadog Integration: When the custom fields are populated on the Log Entry record, then plugin class will be executed which will perform the Datadog Integration to send the Log details as a JSON to the datadog.
We just need an approach for Logging & Datadog Integration from flow as the latest nebula logger package already has custom mapping feature implementation introduced in apex and LWC.
I also have the following suggestive approach for logging in flow for custom fields-
We are going to create a replica for FlowLogEntry to get all the standard logger attributes as well as add our custom attributes, and replace the flow apex action Add Log Entry with our new apex class. When this new apex class is executed from the flow action it will map the custom attributes in the platform event record using the “getLogEntryEvent” function and for the standard attributes it will call the logger functionality FlowLogger class for processing and finally save the Log records.
PRO: : No custom code or optimizations will be done in the nebula package-specific classes. CON: : Whenever the latest package version will be introduced and installed with the latest features in the flow actions (FlowLogEntry, FlowRecordLogEntry, and FlowCollectionLogEntry), we have to manually update my custom class as well.
Please let me know if you have any questions/thoughts on this approach or if we should wait until you release this feature implementation for flow ?
Hi @jongpie, can you please provide me an ETA for this issue? As once this feature is released, we are going to leverage these custom mapping attributes for datadog integration.
Thanks!
Hi @JaskiratSinghIH at the moment, I still haven't found a good approach that will work in Flow. The combination of some UI limitations in Flow + the lack of support for the generic Object data type in Flow make all of this rather difficult to do dynamically in Flow.
I definitely want to revisit this & continue to explore options - but right now, my guess is I won't have a solution ready this year.