Add an Object And Field Picker to your Flow

A growing number of Flow components and actions involve selecting either 1) an object type (“Account”), or 2) a field name (“Account Number”) or 3) both.

This Flow screen component provides a pair of picklists that you can drop into a screen that will show either the full set of available values in your org or a subset that you specify.

Installation

Install Package

The package includes a sample flow called Select Object And Field Demo.

Available Parameters

masterLabel – Master label of the component

objectLabel(default "Object")– Label for "Choose Object" field

fieldLabel(default "Field") – Label for "Choose Field" field

objectType – initialization value for object name, supports all standard and custom objects

field – initialization value for field name, should be valid field on selected object, can not be specified if objectType is empty

availableObjectTypes – comma separated list of selectable object names, which should be available to select in objectType field. If this value is not set, objectType will show all existing standard and custom objects

availableFields() – comma separated list of supported reference types, f.e. "User, Account" will result only fields of these types to be shown in "set field" component, all other references will be avoided.

disableObjectPicklist( default = false) – Object picklist is visible, but disabled. If this is true, a value must be provided for objectType

hideObjectPicklist( default = false) – Object picklist is hidden. If this is true, a value must be provided for objectType

hideFieldPicklist( default = false) – will show only object selection and field select will be hidden

displayFieldType( default = false) – if field is selected it will show field type

Developer Notes

View Source

This component is available in the Flow Base Components package library, and we recommend that you use it from there instead of adding it separately to your projects.

Subscribe
Notify of
guest
6 Comments
Inline Feedbacks
View all comments

[…] that uses dot notation, like this: “Account.Type”. (If you’re using the Object and Field picker, use a formula resource to join the two values into this […]

Dhana

I wasnt able to install this in to my Sandbox instance and getting the below error

Problem:

1. Apex compile failure
Apex class NewCommentComponentController: line 759, column 31:
SELECT Email, Account.Name FROM User WHERE Id
^
ERROR at Row:1:Column:15
Didn’t understand relationship ‘Account’ in field path. If you are attempting to use a custom relationship, be sure to append the ‘__r’ after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

Alex Edelstein

Hi, Dhana. That looks like an error that’s not related to this component. Look for that apex class in that org and try to delete or fix it. Because it’s broken, you won’t be able to install any new packages to that org until you do.

[…] which Field” and “Output which Field” use the latest version of the PickObjectAndField component. As before, this version provides the ability to drop an Object and Field picklist pair […]

[…] Reference […]

[…] Reference […]