To dot walk into a variable of a catalog item so that send Notification if condition satisfies

rishabh31
Mega Sage

Dear Team,

 

I have a requirement where there is a catalog item, that catalog item has a Checkbox Variable named 'SAP Flow', what I want is to send a Notification to specific users when in Catalog form any user checks the SAP Flow variable (SAP Flow=True). So I am trying this through New Notification and setting Condition through 'when to send' something like When to Send> Catalog item>Variable>SAP Flow is True, but not fulfilled.

 

rishabh31_0-1688756035878.png

 

Requesting help to get this resolved

1 ACCEPTED SOLUTION

OK, here is a rough example using my sn developer instance oob workflow:

Open the workflow in workflow editor and add the IF gate after the approval action, before the task is created.

jMarshal_0-1688761380447.png



Then, configure the IF gate to look for the variable value:

jMarshal_1-1688761414768.png


Then add the event or notification in the workflow for "Yes". If you are using a very basic email notification, you can put it right here...

...or if you want to trigger other things off of this event, without needing to further modify the workflow in the future, use an event...or if you want to use features that are available in email notifications that may not be available in the workflow notification.

jMarshal_2-1688761723703.png


Since you already have the notification created, may as well use an event. This is what I'll provide in the example.

You can create a new event in the event registry or from the workflow here (you need to create the new event regardless). Also, if you need data from the catalog item, for the notification, you can pass that to the event using the 2 parameters (oob only supports 2 parameters) - usually people use the RITM number here as you can then write scripts to access other data elements from that item, if needed. See the highlighted portion below

jMarshal_3-1688762091844.png


The event doesn't have to be anything "fancy" (you can leave stuff blank, only a name is mandatory)...but should be configured to provide information about what it is for.

Events in the event registry use "dot notation" to separate the words as a best practice -- no spaces. Even though I believe it technically supports dashes and underscores, I'd recommend avoiding dashes and underscores (stick to dot notation, matching oob events).

It is also best practice to name it to reference the table which calls it, as well as the action is is for...I didn't do this in the example below. Using the same naming structure as oob events, you may want to call it "sc_req_item.sap.email.event" if you specify the table as shown below - but that's not a requirement.

The most important thing for the name or properties of the event in the registry is that it is meaningful and represents what it is for.

jMarshal_4-1688762436348.png


If you chose to instead just stick a notification here in the workflow, instead of an event, you're done...just publish the workflow and imagine the screenshot below has the notification in place of the event. If you chose to use an event, you're still publishing - but it'll look like this:

jMarshal_5-1688762780736.png


If using the event, after publishing the new workflow, go to the notification you created and change it to be triggered by the event you created. I didn't actually create a new event in my sn developer instance, so the image below would have the event name you created before (sap.email.event) in the example above.

jMarshal_6-1688763147372.png

 

HOPE THIS HELPS!!


View solution in original post

18 REPLIES 18

jMarshal
Mega Sage
Mega Sage

Use events! -> Have the catalog item create an event in the event table when it is created and SAP is true, then have the notification trigger on the event creation.

@jMarshal  Sir Thanks for response, Could you please help me with the steps and what script to be write, as I am new to such requirements.

Yes, no problem -- what's the process engine you're using? You may not even need to use events, if you are using modern flows...

@jMarshal Sir, I am using Workflow.