Skip to content

How ChatGPT helped me build a Salesforce solution

AI Artificial Intelligence

With the rising discussions around ChatGPT and how it can support Salesforce admins and developers I became more and more curious on how I could use this in my day to day work as a Salesforce Consultant and Administrator. When the opportunity arose, I decided to delve in and see whether it could help me with a ‘real-life’ problem.

What is ChatGPT?

ChatGPT is an Artificial Intelligence (AI) chatbot developed by OpenAI which is able to hold conversations with the end user. Unlike a search engine it should give more intelligent answers, more specific to your requirements, but like a search engine it can also be very wrong!

The problem to solve…

One of my clients is moving from a legacy CRM platform to Salesforce. They wanted the new Salesforce Addressee field to follow exactly the same logic as in their existing platform. The client provided the following logic:

If Addressee is not null then Addressee ELSE
If prefix is null then Firstname Lastname Suffix
If prefix is not null then Prefix Firstname Lastname Suffix

The first thing I did was log into ChatGPT and ask ‘What does this mean’? It’s nice to get a breakdown of the requirements.

ChatGPT Requirements

I then asked ChatGPT to give me a Salesforce formula based on the above requirements and the output it gave me was:

Initial ChatGPT Salesforce Formula

Now this is great, except Addressee and Suffix are not the correct Salesforce field names. I asked ChatGPT to replace Addressee with ‘Envelope_Addressee__c’ and Suffix with ‘Suffix__c’ and it gave me this output:

Correct ChatGPT Salesforce Formula

I popped this into a formula field in Sandbox and got no syntax errors – what a result!

I then asked ChatGPT to give me a summary of the formula at the end within the /* */ notation, as this is a great way to give the details of what the formula is doing.

ChatGPT Salesforce Formula output with comments

The result….

This is how it looks in Salesforce:

Salesforce Addressee__c Formula

I then got the users to test in the sandbox, to validate that it is working correctly. The formula is now awaiting deployment to production as part of their Salesforce installation.

The final verdict and some Shakespearean fun

In summary, ChatGPT was a great help with this formula, however you do need to know Salesforce and how formulas work in order to utilise ChatGPT. For example, ChatGPT loves to give result without any consideration for the field names, it also does not consider field type; you will have to ask it to point out a field is a picklist or a date field.

Overall, I have found that ChatGPT speeds up the process of writing formulas – and is definitely a handy translator! If you have a formula in your Salesforce org that you don’t understand, ask ChatGPT to translate it for you.

Finally, just for fun I asked chat ChatGPT, to read the formula to us like Shakespeare…and this was the output…

ChatGPT Shakespeare output

What are you going to use ChatGPT for? Let me know your ideas!

Header Image by Vicki Hamilton from Pixabay

Share This Post

More To Explore

Community

Exciting Salesforce Community Events Ahead

In the coming weeks, I have some super exciting Salesforce Community events coming up and I wanted to share my excitement about them! CzechDreamin’ Salesforce

Interested in what you saw here?

We have helped...