function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Wolf DuttlingerWolf Duttlinger 

"Joins" in Flows

Hi,

following set-up.
Account  1 ---- n Junction m ---- 1 Campaign
Junction has an attribute: responded.
Campaign has attributes: active and name

So I come into a flow and have one Account. I want to display the value of "responded" for all Campaigns that are connected to this particular Account - but only those Campaigns that are active.

Should be looking like:
===========================
This is the current state for all active campaigns on account XXXXXX:

[ ] Campaign 1
[X ] Campaign 2
[ ] Campaign 3
[ X] Campaign 6
[ ] Campaign 9
===========================

In SQL I would be using something like 
SELECT j.id, j.repsonded, c.name FROM junction j, campaign c WHERE c.active = true AND j.campaignId = c.id AND j.accountId = :myAccountId

But seems that Salesforce didn't come to the 70's yet....

I (think I) understand that I could use some form of a RecordChoiceSet that then would be used to show a CheckboxGroup.

Label of each checkbox would be the name of the campaign and checkbox state the value of responded. 

BUT: how would I be doing this? I tried to use a Get Records reading all Junction entries for my Account and stored the result in a Record Collection.

a) I need to remove the Junction records from this collection whose Campaign is Inactive - how to remove...(or loop over the collection, execute a Get Record for each Campaign , make a Decision  and then.... how to "manually" add a record to a "new" collection?????)
b) I need to carry the Campaign Name into each member of the collection

Any ideas anybody? Or should I rather stop this whole endevour and try my best with LWC???

Thanks
Wolf
 
AbhishekAbhishek (Salesforce Developers) 
Wolf I would suggest going which Lighting Web component.