3

I read elsewhere that I can pass an event's payload to a flow from a process builder process. When I try pass values in my process all I see are the different fields from my platform event object. Do I need to pass field by field to a corresponding variable in the flow? Thanks!

  • Are the contents of the event payload that you would like to interact with in your flow sourced from Salesforce data? – Ayoola Olapo May 30 '19 at 19:57
  • I've been playing around with it and I had even a hard time getting the flow to let me pass a single field. When defining a process builder it required I select a different type of record (I chose contact) and it would only let me add fields from that record to the flow, not from the event itself. – gNerb May 30 '19 at 20:07
  • looks like this is coming in winter 20 – gorav Sep 22 '19 at 17:37
0

Without custom code, yes you will need to map each Flow variable individually as per the documentation

However, it seems that you may be creating the process builder for your use case incorrectly:

In Process Builder, create a process and for The process starts when select A platform event occurs. Add a trigger. Under Platform Event select Platform Status Alert Event.

0

I typically just pass the ID and have the flow do a lookup to get the rest of the variables I need. Thanks to cropredy for pointing out that is not possible with platform events.

You can subscribe to platform events directly in flow, in which case you can set a record variable to the platform event, and then reference the platform event fields via flow formula fields.

See this document

When the flow interview resumes, the {!vendorResponse} record variable is populated with the data from the event message (3).

That said, i just tested this in a flow and I am getting an error when I try to save the pause element : The data type of the resource you entered isn't compatible.

Its possible that is related to the new flow builder.

It seems to me that it is not possible to pass event field values directly to a flow - only to reference them in the process and evaluate against an object. It appears that the recommended approach is to subscribe to the event directly from the flow.

  • 2
    you can't query Platform Events by ID - no SOQL support – cropredy May 31 '19 at 0:22
  • 1
    Thanks gorav. That is exactly why I posted this question - the data type error. Now you say the recommended approach is to subscribe directly from the flow. All the documentation I've read leads me to this error. Thanks for looking into it and try it though. – Esau Sanchez May 31 '19 at 20:24
  • UPDATE: So I decided to go back to Cloud Flow Designer to check if the error would also show up there. Well, what do you know... NO ERROR! So, I saved the flow, then opened it with the new Flow Builder and continued my flow. I'm still trying to get the data from the platform event into the flow. I tried passing the reply ID in the Process without success. – Esau Sanchez Jun 3 '19 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.