Hi this is Adam from Customer Success, and today I want to share with you about how you can deal with empty values error.
There are times where you faces errors such as these :
These errors are given by applications such as Salesforce or QuickBooks, saying that the required fields do not have any values. To confirm what is happening in your recipe, click on the failed job description, and find for the field and step that the error is coming from. Upon determining the step, we can go back to the recipe and check it out.
At first glance, it seems that the field already has value mapped, but the recipe is still throwing error! However, do note that data pills refers to a field for a specific record coming from an app on the right side of the field. These data pills may or may not be having any value, especially when it is not a required field.
To resolve this, we can use formula mode to include more pills that may have data using the "or" keyword.
The "or" keyword provides the ability of flexible data mapping. When the 'or' is present, Workato will use either of the data pill that may have data in it. If both data pills have value, the first data pill that appear will be used.
In this case, I am telling QuickBooks that for Display Name of the customer that I am going to create, use 'Forecast Category Name' data pill. If it doesn't have any value, use 'User name' data pill.
'or' in recipe building
This method of data mapping is extremely useful when you are dealing with data that may be potentially missing. Example of this would be when populating required fields. For example, I have a scenario where I want to create a new contact in Salesforce based on a Search result in QuickBooks.
As you can see, there will be two steps with customer data that I can use in my Step 4: Create contact in salesforce. I can use the data from my search action, or the data when I create a new customer in QuickBooks.
In this screenshot, I am using the family name from Step 1: Search customer for my Required field. This is dangerous because Family Name in a Customer in QuickBooks may be empty, and that will cause an error in the recipe when Workato tries to create a contact in Salesforce. The way to solve this would be using the 'or' keyword and formula mode.
I can now use Family Name from my Create Customer in QuickBooks step. I can now know that as long as I have value in my Create customer's Family name data field, This data pill will always return a value. With this, I can rest assure that my Create Contact In Salesforce will not fail because of a missing value in my required field: Last Name
That's all from me on this topic. There are other ways that you can deal with missing or blank data written by Allan from Customer Success here, as well as list of other common formula that you might be interested in such as splitting values in a data pill, and how to get First Name and Last Name from a Full Name data pill.
Hope this finds you well, and happy recipe building!
Send us a ticket, we will try our best to assist you with your problem