0

The following flow is meant to delete GroupMembeship records for a given UserID.

enter image description here

The Fast Lookup STEP 1 is as follows:

enter image description here

...while the Decision STEP 2 is as follows:

enter image description here

I have a disconnect mentally on making the OUTCOME work on the Decision element.

I want "Found some" to happen IF any records were found during Fast Lookup. Else, "default" happens (which is linked to nothing).

When I test this with a user who does NOT HAVE a GroupMember record for a specific group, the DECISION element is going to "Found some". Note the below Error Output (from email). Somehow when I try using the sObject I THINK should be used, and select "is null", it still demands a Value on the right side of the screenshot. When I use the name of the STEP 1 FAST LOOKUP, it at least allows use of "is null" with no value... but doesn't resolve correctly.

FAST LOOKUP: Find_GroupMember_records_for_the_UserID
Find all GroupMember records where:
UserOrGroupId Equals {!UserID} (00521000000WSYQAA4)
GroupId Equals {!GroupID} (00G21000000gVcp)
Assign those records to {!GroupMemberRecordsToDelete}.
Save these field values in the variable: Id

Result
Failed to find records.

DECISION: Find_any_records
>>>>>>>> Executed this outcome: Found_some <<<<<<<<
Outcome conditions: and
1. {!Find_GroupMember_records_for_the_UserID} (false) Does not equal null
Logic: All conditions must be true (AND)

My confusion is that the sObject I think I should be referencing at DECISION does not allow "is null" to be picked WITHOUT requiring a "value" be set, which makes no sense to me. HELP!

I cannot add a "Screen" for debugging as this is Automated and you can't edit it after saving as Automated, even if you SaveAs.

2 Answers 2

2

Amm - you need to have your decision element that looks at your lookup to be: [Resource: Find_membership element equals True]

This will give you, if something is returned, do the next thing I want, and the default outcome is pointed to nothing.

enter image description here

1
  • ....and JUST like that, my Flow works perfectly. True... as in, something was found (versus null). Makes perfect sense (sigh) Thank you kindly.
    – AMM
    Commented Feb 23, 2017 at 21:51
1

In the above solution you can omit the usage of loop and simply use the new feature from Winter 18, which allows you to get a count of the records directly. That count could act as your decision maker.

So to answer this question, all you simply need to do is like:

  1. Perform a fast lookup with your required filters enter image description here
  2. Assign the record count to a sObject collections variable. (in screenshot: nofCases)
  3. Use a Assignment step, to assign the variable to a number variable. (Point to note: the assignment variable should be of type number only to make use of equals count operator. In the screenshot, this is called testCount) enter image description here
  4. Voila! Now play around with the assigned variable :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .