ChatGPT has shown the world the potential of AI beyond simple chatbots. One million people signed up in the first 5 days and are sharing remarkable results. Let’s see what is ChatGPT and what are the implication of ChatGPT to Salesforce Developers and how to use Chat GPT for Salesforce.
What is ChatGPT?
What is ChatGPT? It is an AI (Artificial Intelligence) chatbot or LLM (Large Language Model) that uses natural language processing (NLP) to interact through simple language, just like talking to a person. OpenAI is the company behind ChatGPT and they are heavily backed by Mircosoft.
AI technology is now at a level of maturity that could become disruptive. Google has AI programs but does not yet want to launch as it has concerns about its reputation due to the quality of the results.
OpenAPI CEO, Sam Altman who is clearly tempering expectations, recently tweeted: “ChatGPT is incredibly limited, but good enough at some things to create a misleading impression of greatness. it’s a mistake to be relying on it for anything important right now. it’s a preview of progress; we have lots of work to do on robustness and truthfulness.”
This feels like it is downplaying the potential for ChatGPT which is an incredibly fast and obedient junior developer/admin. ChatGPT can create amazing results with very limited input; Validation Rules, Apex Code, or even a blog post. This post may have been written by ChatGPT – and you wouldn’t even realize it. However, there are some limitations, but more of this later.
How ChatGPT works
You type a request – a prompt – much like a search request in Google, but using sentences like you would talk to a person. ChatGPT formulates an answer and presents it back in a remarkably natural, conversational style. It is not creating new ideas or content because it is drawing on its enormous database of information captured from millions of websites.
If you provide a tight and explicit prompt the result is much better. You also need to consider that the result might not be 100% accurate. The implications are you need to understand the problem that you are trying to solve and be able to validate the answer. Think of ChatGPT as a very efficient and capable assistant or consultant.
If the result is not correct, then you can modify the prompt and it will correct the answer. It is training you to ask the questions in the right way and you are training it to give better answers.
The end of Salesforce developers?
ChatGPTs results are textual, not graphical. So they are perfect for writing code. For example, it can create a Formula, Validation Rule, Apex Class, Lightning Web Component (LWC) or a Unit Test for a LWC. It cannot create a Flow or any declarative result but it can create the XML that is generated from declarative action, such as creating an object and fields.
ChatGPT is perfect for a well-defined, narrow scope. Give it a broader problem and the results are less convincing. You cannot get it to write the XML to configure Salesforce for a yoga studio, no matter how much detail you give it.
Here is a Reddit discussion with a number of examples using ChatGPT for Salesforce https://www.reddit.com/r/salesforce/comments/ze23bq/chatgpt_uses_with_salesforce/
Junior developers are at the greatest risk.
Junior developers are at the greatest risk. ChatGPT has learned from millions and millions of lines of code. This has made it very effective at coding. The code is not always 100% correct, but ChatGPT does a huge amount of boring work which can then be modified by an experienced developer.
As a junior developer, ChatGPT could be used to accelerate their coding skills by creating a prompt and then looking at the ChatGPT answer. The other angle is for them to gain skills as a Prompt Engineer.
There is now a website – PromptBase – that offers “Prompt Engineers” who are skilled at phrasing the question in the right way and or you can buy pre-built prompts that give great results. This of course does not help if you are not able to validate the results. ChatGPT does not replace experience.
There are clear benefits in using AI to support code development. Developers who outsourced code development to Copilot, an AI service like ChatGPT that is connected to GiHub, said they saved 50% in development time. And they outsource up to 40% of their code development to Copilot.
Don’t worry it can’t replace Salesforce Developer completely. They still need to learn Salesforce best practices.
There is now a new role that has emerged – “Prompt Engineers” – who are skilled at phrasing the question in the right way. But the Salesforce ecosystem can all work together to share and improve on the prompts that we put into ChatGPT. Tweaking the words or the order of the words can dramatically improve the results.
So we have launched a site called SalesforcePrompts where anyone can share their prompts and results and then collaborate. People can use the site as a place to store prompts privately, but we hope they will make them public so we can all benefit.
Limitations or considerations
ChatGPT – and other LLMs – seem to produce elegant, accurate results but they are still far from perfect, as OpenAPI CEO, Sam Altman’s tweet acknowledged. As the are building their results millions of websites that are not not validated. Therefore ChatGPT and LLMs reinforce social biases often dissing women and people of color, and making up historical and biographical data, to justifying false and dangerous claims. This may also be why ChatGPT is so good at writing code as the training data is millions of lines of code that works.
These problmes are less of an issue to the Salesforce ecosystem where the obvious application of ChatGPT is generating specific content, such as a Formula rather than asking for opionions.
But as we’ve said, ChatGPT is not a replacement for experience. You can only create the prompt if you understand what you want. And you can only use the result if you have the skills to know that it is correct.
Get started with ChatGPT
Here is the link to login to ChatGPT. https://chat.openai.com/auth/login
You may struggle to get a login as the demand is so great. But once you do, you will be hooked and find you have spent hours exploring different scenarios and use cases.
Create Trigger using CHATGPT for Salesforce
Watching ChatGPT generate the results is jaw-dropping. And this is just the beginning as there is huge untapped potential. Over the coming months, the Salesforce ecosystem will identify the use cases where it really excels. But it ChatGPT is only as good as the expertise of the person creating the prompt. You cannot ask it to produce something you don’t understand. Firstly, because you cannot phrase the prompt to get the optimal result, and secondly you can’t understand the answer.
For example, I asked ChatGPT this
“write blog on how chatgpt will improve productivity salesforce developers to write Apex, LWC”
And the result was so generic
Authors Ian Gotts, input from Rory Plewes and Walter Bril