- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 11:57 AM
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.
Requesting help to get this resolved
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 02:09 PM
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.
Then, configure the IF gate to look for the variable value:
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.
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
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.
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:
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.
HOPE THIS HELPS!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 12:32 PM
@Ravi Chandra_K thanks, so is this Notification to be created on sc_req_item OR sc_cat_item?
And I have to add some variables like 'Requested for' in what it will contain, so how can I display that.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 02:17 PM
@rishabh31 - a word of caution...this will work (scripting an advanced condition directly on the notification)...but not how you have already started your notification trigger in your screenshot, which is looking at sc_cat_item...you need to be looking at sc_req_item when triggering on "record inserted or updated", else you'll be looking for when you create a new catalog item for the catalog/portal...not for when a request is made FROM the catalog on the portal.
If using an event, you do not need to specify a table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 08:11 PM
@Ravi Chandra_K Thanks, This notification will be on sc_req_item and your provided script is fine but how can I access a variable of a particular catalog item because script: current.variables.<variable_backened_name> access or checks the every request item's variable of each catalog item.
What if I want this to check only a particular catalog item's request item that have this sap_flow check box variable to be true?
Could you please help me here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 12:17 PM
Hi @rishabh31
Add below condition in when to send:-
In condition I) show related fields -> variables.
II) select item(select your catalog item name).
III)select variable(select your variable(SAP Flow)).
Iv) then set to condition (SAP flow is true).
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
Regards,
Ranjit Nimbalkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 12:20 PM
@Ranjit Nimbalka No its not working