 Hello, friends. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate you how you can implement is changed and prior value in lightning flow before starting. Let me tell you this website study salesforce.com. So on this website, I have put all the video links that I created related to salesforce topics. These are listed here and I selected flow already. So these are related to flow. So you can visit this website and watch particular video as per your interest. Now moving to this flow, I'm going to select a new flow and to implement this requirement to show behavior of is changed and prior value. So I'm selecting record trigger flow, right? So now the use case is I'm going to launch this record trigger flow for opportunity object. And whenever any stage is changing on opportunity, then we need to check whether stage is changed or not. Right? So if it is changed, so I will be updating description of opportunity with the current stage. If it is not changed, so I will be mentioning like stages not changed in the description field of opportunity. Right? So I'm selecting this created or updated. Then selecting this before save when I'm choosing the opportunity object. And here I'm choosing none. Right? Now I'm selecting decision. So its label will be checked prior value is changed. So now how you can do that. So here you can see two entities are available record and record prior. So this record shows the current record on which this record trigger flow is triggered. So record dot stage does not equal and prior value you can identify through this record underscore underscore prior. So stays. So if current record stays the stays that you updated and the previous value of that stays, if both are not equal, it means you change the stays, right? And not changed. So here I can put record dot stage equals record prior dot stage name. Right? If both are equal, it means you didn't change stage. You changed something else. So I'm connecting this now putting one assignment. So update description. So I hope you understood how we can compare current or prior values to implement a change behavior. So now I'm just your report dot description equals. So I'm just putting current stage, if it is changed. So if stage is changed so current stays will be updated into description. Otherwise, so here I'm, I will be just putting the plain text like stays is not changed. Right. And I am linking it here. Right. So I selected before safe because I just want to update the current record. If I want to update the related record then I have choose this after the record is safe thing. This is done. Clicking on save is change and prior value demo. Clicking on save activate moving to opportunity. So I'm just going to open sales application where we can find opportunity tab. So here it is. So I'm going to open one opportunity. So if I move to details. So here you can see stages available it is prospecting as of now. And in description you can see it is having test. So now I am changing stays to qualification clicking on save moving to description so you can see qualification is populated here. Now this time I'm going to change something else. Let's say type. Right. So I'm not updating stays. I'm just updating type. So that flow will run and it will. Okay, it is not dating. So actually what I did I did a mistake. So here you can see stages not updated is populated. So the mistake was instead of putting description here I put the stage. So now I'm updating it as description. Clicking on save as to create new version. Activating it. So now I'm selecting. Let's say prospecting again clicking on save. So here you can see prospecting is available. And this time again I'm going to change the type. So I'm changing type. So clicking on save stages prospecting I'm not changing that and here you can see stages not updated. So in both the way it is working fine. So one mistake I did so you need to focus on this like a particular field you need to select otherwise your data will not be inconsistent your data won't be consistent so I hope this way you can implement a change behavior with the help of this current record value and prior value. So I hope this way you understood how we can implement both the things like how to check is changed and how to get the prior value of a particular record. So this is required in many of the scenarios while you will be working on the real life projects. If you want to watch more videos related to these kind of scenarios so visit this website. You will find a complete library of Salesforce video so do watch them. Thank you for watching this video.