Skip to main content
Sam Sallis perguntou em #Flow

Hi

I've setup a flow to add multiple accounts to an opportunity based on certain criteria, however, I'm having issues removing duplicate accounts from being displayed in the data table.

 

New object - Stakeholders

Master- Detail - opportunity

Lookup - Account

 

It is a screen flow that displays existing Stakeholders (new object) as well as potential stakeholders (Account Object).

 

Flow:

Get Existing Stakeholders -> Get Accounts -> Screen (shows both existing & potential) -> user selects new accounts to be Stakeholders -> Creates new record\s in the custom object Stakeholders

 

I want to check which Account Ids already exist as existing Stakeholders and show the remaining potential accounts in the user screen that can then be created as Stakeholders against the opportunity.

 

Currently in my flow it is showing

Opportunity ABC : Existing Stakeholders (object - Stakeholders)

  • Account A
  • Account B

Potential Stakeholders - (Object- Account)

  • Account A
  • Account B
  • Account Z
  • Account Y

I want it to show..

Opportunity ABC : Existing Stakeholders

  • Account A
  • Account B

Potential Stakeholders - that the users can select to create new Stakeholders against the opportunity

  • Account Z
  • Account Y

Thanks

Sam

3 respostas
  1. 13 de mai. de 2023, 04:57

    Hi,

     

    To find duplicates in a screen flow and display unique AccountIds for selection, you can follow these steps:

    1. Create a Screen Flow: Build a screen flow that starts on the Opportunity screen. This flow will allow users to select unique AccountIds to create new records on the custom object.
    2. Get AccountIds from Custom Object: Use a "Record Lookup" element to retrieve the AccountIds from the custom object records that meet your specified criteria. Store these AccountIds in a collection variable.
    3. Get AccountIds from Opportunities: Use another "Record Lookup" element to retrieve the AccountIds from the Opportunities that meet the desired criteria. Store these AccountIds in a separate collection variable.
    4. Combine AccountIds: Use a loop or an iterative element in the flow to iterate over each AccountId in both collections. Within the loop, compare each AccountId and store the unique AccountIds in another collection variable.
    5. Display Unique AccountIds: Use a "Screen" element in the flow to display the unique AccountIds to the user. You can use a dropdown or any other input element to allow the user to select the desired AccountId.
    6. Create Records: After the user selects an AccountId, use the selected value to create new records on the custom object using the "Record Create" element.

    By following these steps, you can create a screen flow that displays only unique AccountIds based on specified criteria from both the custom object and the Opportunities. Users can then select the desired AccountId and proceed to create new records on the custom object.

    Remember to handle any error conditions, provide appropriate validation, and ensure that the flow meets your specific requirements and user experience expectations

0/9000