Skip to main content
Adam Justice が「#Data Management」で質問

Hi!

 

Is there a way to utilize the name of a field (e.g. Email Address) in a flow rather than the value of that field (e.g. john@mail.com)? 

 

To give some context: I'm trying to create a flow that creates custom object records (call it Product) based on the values fields from another object (call it Project) when it is created.

 

One of the fields in this new Product custom object is called 'Product Description' and it should be populated by the names of certain fields in the Project object rather than the value of that field.

 

My plan is to pass various fields into collection variables and then loop the creation of new objects from the collections.

 

Thanks,

 

Adam

2 件の回答
  1. Michael Brown (Salesforce) Forum Ambassador
    2022年2月17日 20:00

    Hi Adam, 

     

    You should be able to get this through a couple of Queries. 

     

    There is an object in salesforce called EntityDefinition, which lists all your objects, and then an object called EntityParticle can list all the fields on that object. 

     

    For example, this query in SOQL would return all fields from the Account object. 

    Select MasterLabel from EntityParticle where EntityDefinition.QualifiedApiName = 'Account'

     

    In flow, it doesn't let you reference parent fields, so what you could do is first do a get records to find the EntityDefinition record where the QualifiedApiName is equal to the API Name of your object, and that should return the EntityDefinitionId, which you can then use in a 2nd Get Records statement on the EntityParticle object to only return fields for that object. 

     

    This should give you a record collection variable of all the fields, which you can then loop through. 

     

    Thanks,

    Mikey

0/9000