• Trina Banerjee 22
  • 0 Points
  • Member since 2018

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 1
I have a flow and a lightning component in it. My flow has a variable ObjectID that I want to pass to my lightning component and write a soql based on that variable.
I want to query all records under Portal_Dealer_Relationship__c where ID= ObjectID.
I dont know how to pass this variable and where to use the variable in the component for the SOQL.
Can anyone help please? 
Hello all,

I have a Custom Metadata type that stores records that are equivalent to "Tasks" and contains a few fields that hold criteria text for when these tasks should be created. 

In my Flow, I have a Get request for all Metadata records that match the input criteria, and then I loop through those Metadata records and assign each to a Task sObject variable and add them to a collection of Tasks for insert.  I include the Metadata Id field on a task field when I insert them.  This all works well.

The issue happens when I try to remove duplicate values from the Metadata because the Tasks are ALREADY EXISTING...

Here is what I tried to do:
  1. Find all the existing Tasks on object
    1. Get all Tasks
    2. Add to sObject Record Collection Variable (ExistingTasks) and capture Task Field "Metadata_Id__c" which = the SF Id of the Metadata
  2. Loop through ExistingTasks to get collection
    1. Each record is called ThisExistingTask
    2. Assign ThisExistingTask.Metadata_Id__c to a sObject Record Variable called ThisMetadata
    3. Add ThisMetadata record to a sObject Metadata record collection variable called ExistingMetadata
  3. Use the input criteria to Get the new Metadata
    1. Get Metadata records that meet the input criteria
    2. Add these to a Collection callend NewMetadata
  4. Loop through ExistingMetadata collection to remove from NewMetadata
    1. For each record in ExistingMetadata collection called ThisExistingMetadata
    2. Use an Assignment node to "Remove All" ThisExistingMetadata from collection NewMetadata
  5. //do more stuff

However, the Remove All assignment node is not removing the sObjects from the NewMetadata collection as I would anticipate.  

Can anyone please help?