This post was originally published here
There are times where you need to do data type conversions in a Logic App.
I recently ran into an issue where I was syncing records between CRMOL (on line) and Salesforce. The record coming from CRMOL had NULL values. When converted to JSON, the NULL value is a string.
I could use the Logic App Replace function, but when you have to evaluate 30 to 50 fields, it becomes a tedious chore.
I decided to create a Function App. I used a C# Web Hook, so I can pass in the Response coming out of CRMOL. I could return the parsed Record to be mapped to Salesforce.
The code is very simple. I loop through each field and replace the “NULL” values with a empty string.
In Part – 2, I will show you the code and other utility functions that can be used in Logic Apps.