Quantcast
Channel: Dynamics Communities
Viewing all articles
Browse latest Browse all 973

AI Suggestions for Formula Columns in Power Platform

$
0
0

AI features are popping up throughout the entire Power Platform tech stack! In this post, I want to spend some time diving into the AI suggestions for formula columns. This feature is currently in Preview, so it’s a great time to play around with it and get to know how it works.

This is an environment-level setting, so if you’re using more than one environment, you will need to turn it on anywhere you are ready for it.

Turning It On

If you want to get started using this preview feature, head over to the Power Platform Admin Center. Once you’ve selected the preferred environment, go to the Settings, then select Features.

A screenshot of a computer

Description automatically generated

Scroll down a bit until you see the heading AI suggestions for formula columns. Toggle “Allow users to get AI suggestions when creating formula columns” to ON.

A screenshot of a computer

Description automatically generated

Reminder: This is a preview feature. You should turn it on in a Sandbox environment, but Preview items are not recommended for use in a Production environment.

Using AI Suggestions

Now, let’s head over to the Maker Portal to show this preview feature off! I’ve gone into a Solution file that has my Opportunity table included. I have added a new column and selected a data type of formula. Since I have toggled this feature on in the Power Platform Admin Center, I now have up and down arrows next to the “Type a formula” header:

A screenshot of a computer

Description automatically generated

Clicking that menu icon expands these two options:

  • Type a formula (the standard way to create a formula column)
  • Get formula suggestions (using AI)

A screenshot of a computer

Description automatically generated
After selecting the second option, you will now see this:

A screenshot of a computer

Description automatically generated

Now, you can enter your formula criteria using natural language queries and it will generated a formula you can use.

Reminder: Always check what AI returns here. Say it with me friends “trust, but verify!”

In this example, I’ve entered the following prompt: Days since Opportunity was Won or Lost.

It provided me with the following Suggested Formula:

If(ThisRecord.Status = opportunity_opportunity_statecode.Won || ThisRecord.Status = opportunity_opportunity_statecode.Lost, DateDiff(Now(), ThisRecord.’Won Date’), Blank())

It’s close but not completely correct. I’ve modified it in the following ways:

  • Switched the order on DateDiff to fit the proper syntax I need (otherwise, I would get negative values instead of what I am looking for: Today – Record Won Date).
  • Removed “Won Date” and replaced with the correct field “Actual Close Date.

The revised formula becomes:

If(

ThisRecord.Status = opportunity_opportunity_statecode.Won || ThisRecord.Status = opportunity_opportunity_statecode.Lost,

DateDiff(ThisRecord.’Actual Close Date’, Now()),

Blank()

)

Troubleshooting Errors using ChatGPT

This looked great… until I went to implement it. Then I got this error:

A screenshot of a computer

Description automatically generated

I wasn’t completely sure how to troubleshoot this one, but I am a big fan of using ChatGPT as part of my toolkit. So, I copied the above image, and pasted it into ChatGPT, which told me that this is my problem:

A black text on a white background

Description automatically generated

And gave me thre options to fix it. Since my users all are in different time zones, I used the simple fix of using UTCNow() instead of Now(), which let me save my field in Dataverse.

The new, revised formula I entered into Dataverse is:

If(

ThisRecord.Status = opportunity_opportunity_statecode.Won || ThisRecord.Status = opportunity_opportunity_statecode.Lost,

DateDiff(ThisRecord.’Actual Close Date’, UTCNow()),

Blank()

)

The New Field

With no further ado or additional troubleshooting, we were able to add the new formula column to a view for Closed Opportunities, and voila!

A screenshot of a computer

Description automatically generated

Closing Thoughts

Like all AI tools, this one is designed to save time and maximize efficiency. Like many things in preview, it’s still getting polished. The key here, with all things AI in the Power Platform stack, is to always verify results before using them in a system. And I still continue my love of using ChatGPT to troubleshoot issues and errors.


The post AI Suggestions for Formula Columns in Power Platform appeared first on Dynamics Communities.


Viewing all articles
Browse latest Browse all 973

Trending Articles