Tuesday, July 4, 2023

#974 OIC & SFDC Streaming API and Platform Events







The OIC SFDC adapter also supports Salesforce Streaming API, something I've never tried out, until now that is. The Streaming API works on the basis of Platform Events e.g. new SFDC account created. Think of it this way - as soon as a new SFDC account is created, push it to the SFDC event bus. OIC will pick it up from there. 

If you're not the SFDC expert, then I suggest you check out the Platform Events docs here







I add 1 custom field, accountName.

That's the platform event defined, now to SFDC Flow Builder to define what and when we should be publishing; in our case, when a new Account is created. The what is just one field - the account name.



The next step - I add a new action to the flow - Create Record - this will trigger the event. It is configured as follows - 


I need to set the mapping rule, in my case there is only one. Remember, I created only 1 custom field, when defining the platform event. 



Now to OIC...

Create an Integration with SFDC as Trigger




I then add a Logger action - 

Let's do a sanity test - 

I enter a new SFDC Account with an Irish address -


I check out my OIC project Observability page -


Simple and succinct!






No comments: