 Hello, everyone. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate a scenario related to screen flow. Let's understand the requirement of the scenario. So in this video, I'm going to demo you how you can post chatter through screen flow. So the requirement is on creation of opportunity. We need to tag a related account owner and we need to post below message to chatter, right? So the message will be containing the account owner. So I will be tagging that account owner and the message like opportunity is created. And we need to display opportunity name, close date and stays in the message, right? So this is our requirement that we need to implement. So I'm going to create the screen flow. So in this screen flow, basically I will be adding a screen where I will be receiving the opportunity information. So I'm quickly creating a screen. So label of screen is opportunity info. Now here, first of all, I'm putting a text component so that I can receive name of opportunity. If it is required, then I'm selecting date so that I can receive close date of opportunity. I'm making it as required as well. And then I need to pick up pick list. Pick list will be for stage. And it is also required. And here we need to create new choice resource. And we need to have pick list choice set. So the stage pick list is already available with opportunity object. So I just, I'm just going to link that pick list that is available under opportunity object with this flow. So naming it as stays name, then searching for opportunity object data type is pick list and pick list name is stays name and done. Okay, the stage name pick list that is actually available under opportunity object is now linked with this pick list that is available in the flow. So I clicked on done. Now I'm creating one resource as a variable API name will be record ID, data type text and available for input. So I created this record ID so that whenever I will be placing this opportunity flow on account record base. So account record ID will be available automatically in this record ID variable. Okay, so now we have record ID of that particular account. Now, what we need to do, we need to have owner of that account as well. So I'm going to use get record element. So through this get record element, I'm going to get account information. So here I am providing the filter condition so wherever ID is equals to record ID. So account record ID will be matched and that particular record will be query. So only the first record and automatically store all the fields. And then I'm clicking on done. Now, I need to create opportunity record. So for that I am selecting create record. So create opportunity, how many records to create one and then use separate resources and literal values and select opportunity from here. Then you need to map the field so opportunity name will be having value from this screen component name. So close date. So I mapped close date with close date. Then I need to map stage with stage. So screen component and then I'm adding account ID with record ID, right. So this account record will be created. Sorry, opportunity record will be created. Now when I will be using post to chatter element or action. So I need opportunity ID as well because on opportunity I will be posting that chatter masses. So here I need to enable this checkbox so that I can store the newly created opportunity ID. So I'm going to create new resource variable and API name will be opportunity ID. It's data type is text and done. So the opportunity that we are going to create its ID will be stored in this open ID variable and I'm clicking on done. Now after this, I need to have one action. So I'm clicking on this action and here I am searching for post to chatter. Right. So here you can see in post to chatter action, we need to provide label API name and here we need to create a message. So first of all, I am providing the label so post to post chatter to opportunity. Now I need to create a message that will be posted on the chatter. So I'm clicking on new resource and from here I'm going to select text template. So chatter post and here I need to write the message. So I'm selecting view as plain text. Now here I need to set up that message. So I need to have account owner. I need to tag. So if you want to tag someone so you need to use at the rate and then square packet inside this, you can have that resource. So through that get account, we can have the owner ID. Right. And here I'm writing the message opportunity is created. Right. Now here we need to like show the name close date and stays. So I'm writing as a plain text opportunity name and then opportunity name we can have through screen component. Then opportunity date we need to put. So here I'm going to search close date. So it should be close date. And after this, I need to provide stage name. So I am having stays name from here. Right. So this way I created this text template and I'm clicking on done. So here you can see this message is available. Now here I need to provide the ID of the target record. So if you remember like in create record element, I created one resource as opportunity ID. So I'm having that opportunity ID so that this chatter post will be posted on that opportunity. And then I'm clicking on done. So this way the flow is ready to test. So I'm just clicking on save. So labeling it as post to chatter through screen flow clicking on save. Now I'm going to activate it moving to accounts and opening a particular record. So here you can see one flow is already available. So I'm going to replace it. So I am going to edit this page and I'm going to replace this flow. So maybe what you can do you can just search flow here and you can just drag and drop it. But on my record page like this flow component is already available. So I'm just going to change the name. So it is post to chatter. I'm selecting it then enabling this checkbox and save moving back. So here you can see I need to provide name close date and stage. So I'm providing OPP name as one two zero one. I'm populating a close date. I'm populating a stage and clicking on next. So here you can see a related opportunities created if I open this opportunity. So in the details you can see opportunity name is available. Account name is available closed date and stays that we provided. Now if I go to chatter. So here you can see chatter post is available and account owner is my record. Right. So here you can see if I open this account. Okay. So here you can see account owner is already showing through this look up in the compact layout. So Sanjay Gupta is the account owner. So that's why this user is available here and this message is available. Opportunity name, opportunity closed date and stage name. Everything is available. So this way if you want to post to chatter through screen flow. So this way you can implement post to chatter action. Right. And if I go here and check my email. Okay. So there is no notification. So when you post to chatter. Some user. So that user receives a notification. So maybe like in some time I will be receiving a notification as well. So if you had mentioned any user in the chatter post. So that user receives a notification as well. So this is all about how to post to chatter through screen flow.