• Bob Lloyd 2
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
I'm trying to compare 2 lists using flow. I'm not an apex developer and would prefer to do this entirely with clicks. I've tried to do this using 2 fast lookups and then nesting one loop inside the other. The first lookup grabs a set selection of contacts and places into an sobject collection. The second grabs a set of account records and places into a separate sobject. I then start a loop through the contacts and a loop through the accounts. If the accountid=account.id I check a condition. If that condition is true I go to the next contact. If false, it adds the record to new collection variable. If the accountid<>account.id, I loop to the next account.
For me, I call that a "nested loop".
What I'm finding is the inside loop (the one through the accounts) isn't restarting when I go back to next contact. I've turned on debug and I see the iteration of the account loop doesn't restart. Even with ordering the original collections by the accountid/account.id, I'm not getting the desired results.
My questions are: 1) is there a better way to do this type of check? (I want to be able to use nested loops in other items too) and 2) is there a way to get the loop to restart from the original iteration.
Restrictions: there will be more than 100 records, so I will run into limits.
Here's an example of the flow. Please note that HH is the "account" object for me.
Flow with nested loop

 
We have a need to have related content be attached to a contact record and show in the "related content" related list. This works really well, but when I go to the account object that is the master for this record, the related list for "related content" is empty. Basically it isn't acting like other related lists. SF support says this is as documented. Seems strange to me.

Regardless, has anyone got a work-around for this issue?

Thanks
Bob
I'm new to SF and have been successful in some areas and not in others. Hopefully this makes sense and I've used the right terms.

I've been reading about the need to write apex code when you want to update fields between 2 objects when one is standard and one is custom. I have the need to upcate the parent (Account) email (custom field) with the values from the child (contact) when the child is updated. These are both standard objects, so I'm hoping apex isn't required. I haven't had too much success with that (yet).

I've created a lookup between the 2 objects, thereby linking them. There may be many contact records associated with the account record, but only one contact record is set as "head of household". When that record changes the email address (eventually the street address, phone number and other fields will also apply), should transfer to the account's email field.

I attempted to do this using workflow and update field logic, but I was only able to get the update to work when I updated the parent record. I tried to flip it around, puting the flow on the contact record, but I was unable to get the account fields to show as available fields for the update.




I'm trying to compare 2 lists using flow. I'm not an apex developer and would prefer to do this entirely with clicks. I've tried to do this using 2 fast lookups and then nesting one loop inside the other. The first lookup grabs a set selection of contacts and places into an sobject collection. The second grabs a set of account records and places into a separate sobject. I then start a loop through the contacts and a loop through the accounts. If the accountid=account.id I check a condition. If that condition is true I go to the next contact. If false, it adds the record to new collection variable. If the accountid<>account.id, I loop to the next account.
For me, I call that a "nested loop".
What I'm finding is the inside loop (the one through the accounts) isn't restarting when I go back to next contact. I've turned on debug and I see the iteration of the account loop doesn't restart. Even with ordering the original collections by the accountid/account.id, I'm not getting the desired results.
My questions are: 1) is there a better way to do this type of check? (I want to be able to use nested loops in other items too) and 2) is there a way to get the loop to restart from the original iteration.
Restrictions: there will be more than 100 records, so I will run into limits.
Here's an example of the flow. Please note that HH is the "account" object for me.
Flow with nested loop

 
I'm trying to compare 2 lists using flow. I'm not an apex developer and would prefer to do this entirely with clicks. I've tried to do this using 2 fast lookups and then nesting one loop inside the other. The first lookup grabs a set selection of contacts and places into an sobject collection. The second grabs a set of account records and places into a separate sobject. I then start a loop through the contacts and a loop through the accounts. If the accountid=account.id I check a condition. If that condition is true I go to the next contact. If false, it adds the record to new collection variable. If the accountid<>account.id, I loop to the next account.
For me, I call that a "nested loop".
What I'm finding is the inside loop (the one through the accounts) isn't restarting when I go back to next contact. I've turned on debug and I see the iteration of the account loop doesn't restart. Even with ordering the original collections by the accountid/account.id, I'm not getting the desired results.
My questions are: 1) is there a better way to do this type of check? (I want to be able to use nested loops in other items too) and 2) is there a way to get the loop to restart from the original iteration.
Restrictions: there will be more than 100 records, so I will run into limits.
Here's an example of the flow. Please note that HH is the "account" object for me.
Flow with nested loop

 
I'm new to SF and have been successful in some areas and not in others. Hopefully this makes sense and I've used the right terms.

I've been reading about the need to write apex code when you want to update fields between 2 objects when one is standard and one is custom. I have the need to upcate the parent (Account) email (custom field) with the values from the child (contact) when the child is updated. These are both standard objects, so I'm hoping apex isn't required. I haven't had too much success with that (yet).

I've created a lookup between the 2 objects, thereby linking them. There may be many contact records associated with the account record, but only one contact record is set as "head of household". When that record changes the email address (eventually the street address, phone number and other fields will also apply), should transfer to the account's email field.

I attempted to do this using workflow and update field logic, but I was only able to get the update to work when I updated the parent record. I tried to flip it around, puting the flow on the contact record, but I was unable to get the account fields to show as available fields for the update.