Skip to content

Instantly share code, notes, and snippets.

@Szandor72
Created April 2, 2023 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Szandor72/72b3b735889000ec21b3e88fb377fcce to your computer and use it in GitHub Desktop.
Save Szandor72/72b3b735889000ec21b3e88fb377fcce to your computer and use it in GitHub Desktop.
A deliberately bad flow.
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<description>A deliberately bad flow.</description>
<environments>Default</environments>
<interviewLabel>NestedActionsInLoops {!$Flow.CurrentDateTime}</interviewLabel>
<label>NestedActionsInLoops</label>
<loops>
<name>LoopAssets</name>
<label>LoopAssets</label>
<locationX>704</locationX>
<locationY>935</locationY>
<collectionReference>GetAssets</collectionReference>
<iterationOrder>Asc</iterationOrder>
<nextValueConnector>
<targetReference>UpdateCases</targetReference>
</nextValueConnector>
<noMoreValuesConnector>
<targetReference>LoopCases</targetReference>
</noMoreValuesConnector>
</loops>
<loops>
<name>LoopCases</name>
<label>LoopCases</label>
<locationX>528</locationX>
<locationY>695</locationY>
<collectionReference>GetCases</collectionReference>
<iterationOrder>Asc</iterationOrder>
<nextValueConnector>
<targetReference>GetAssets</targetReference>
</nextValueConnector>
<noMoreValuesConnector>
<targetReference>LoopContacts</targetReference>
</noMoreValuesConnector>
</loops>
<loops>
<name>LoopContacts</name>
<label>LoopContacts</label>
<locationX>176</locationX>
<locationY>455</locationY>
<collectionReference>GetContacts</collectionReference>
<iterationOrder>Asc</iterationOrder>
<nextValueConnector>
<targetReference>GetCases</targetReference>
</nextValueConnector>
</loops>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordLookups>
<name>GetAssets</name>
<label>GetAssets</label>
<locationX>704</locationX>
<locationY>815</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>LoopAssets</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>LoopCases.AssetId</elementReference>
</value>
</filters>
<getFirstRecordOnly>false</getFirstRecordOnly>
<object>Asset</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>GetCases</name>
<label>GetCases</label>
<locationX>528</locationX>
<locationY>575</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>LoopCases</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>ContactId</field>
<operator>EqualTo</operator>
<value>
<elementReference>LoopContacts.Id</elementReference>
</value>
</filters>
<filters>
<field>AccountId</field>
<operator>EqualTo</operator>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</filters>
<getFirstRecordOnly>false</getFirstRecordOnly>
<object>Case</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>GetContacts</name>
<label>GetContacts</label>
<locationX>176</locationX>
<locationY>335</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>LoopContacts</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>AccountId</field>
<operator>EqualTo</operator>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</filters>
<getFirstRecordOnly>false</getFirstRecordOnly>
<object>Contact</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordUpdates>
<name>UpdateCases</name>
<label>UpdateCases</label>
<locationX>792</locationX>
<locationY>1055</locationY>
<connector>
<targetReference>LoopAssets</targetReference>
</connector>
<inputReference>LoopCases</inputReference>
</recordUpdates>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>GetContacts</targetReference>
</connector>
<object>Account</object>
<recordTriggerType>CreateAndUpdate</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Draft</status>
</Flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment