I know it's possible to create a Process Builder that executes based on receiving a Platform Event but is it possible to use the Process Builder to simply create a new Record every time an event is received?
https://help.salesforce.com/articleView?id=process_start.htm&type=5
It seems as though I need to specify Matching Criteria for an existing record which is not something I want to do.
I simply want to map fields from the Platform Event to fields on a new custom object Record every time the event is received.
If I receive 50 events, I want to create 50 new records in my custom object.
(I know this can be done via Apex triggers I'm simply trying to avoid doing so for this use case)
Best Answer
From docs:
This bit is bit funny from SF end, But you can bypass it, but providing a dummy record.
Create a dummy Object, with an external field `D_External__c'. Then create a single record of that dummy Object. And set Value of External Field as constant. eg 78234564654
Now add an extra field in your event My_External_Dummy_Field__C , and default its value as
78234564654
. The one you defined in the record you created.This will make sure, each event fired will have My_External_Dummy_Field__C as
78234564654
In your Process Builder, Match your Dummy_Object's external field with
My_External_Dummy_Field__C
As this matching condition will always match because of single record of dummy object and setting the default value of the platform event, your process builder will always run. And you can create do whatever you want.