I have a straightforward autolaunched Flow (triggered by PB). It looks up some characteristics of a CampaignMember
and based on that, returns a score ("fireball") value. The two subflows here write to utility objects for tracing and are not part of the logic of the Flow.
The data for the Flow is held in a Custom Metadata table and queried from the pink "Get Records" node as follows.
Most of the time CampaignMembers
are written one at a time. However, in the case of a Lead conversion, if the Lead
has multiple CampaignMembers
, then the system processes all the Members in one transaction, and the Flow fails with the following message:
Error Occurred: This error occurred when the flow tried to look up records: Disjunctions not supported.
(emphasis mine) Essentially meaning OR queries aren't supported. Googling further, I found this which refers to the documentation, which states:
When you define multiple filters, the filter logic usually defaults to AND. However, if multiple filters have the same field selected and use the equals operator, the filters are combined with OR.
So when more than one CampaignMember
is in the transaction, the system is optimizing the query behind the scenes in a way that contains an OR, which is not allowed for custom metadata queries.
At the moment, the item is set to simply return a default value if it encounters an error, but that is not necessarily the correct value.
I see only two options here:
- Code it - which is fine, but I am really trying to do what I can declaratively
- Use an ordinary object for the lookup instead of custom metadata
What I'd really like to do is to force the batch size of this transaction to 1, since performance isn't a huge consideration and the transaction volume is small.
Any suggestions? Thanks in advance.