- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I want to copy the rejection comment for a requested item into a field in a separate table.
Since the rejection comment is recorded in a "Journal" type field, retrieving it within a flow includes unwanted extra information.
Is there a way to retrieve *only* the comment itself?
It would be ideal if it were managed in a specific table somewhere...
I would like to resolve this using flow actions rather than scripts.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I am suggesting to use GlideRecord in set flow variables flow logic
what did you try? share screenshots
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @bonsai
You can use the .getJournalEntry(1 ) method to parse out just the newest comment without dates or user details.
Use a Run Script or Script step in your flow with the following Script:
var currentItem = fd_data.trigger.current;
var latestComment = currentItem.comments.getJournalEntry( 1); // dont give space before 1
currentItem.setValue('u_your_custom_field', latestComment); // Populate the separate field/table (use glide record) with this extracted text
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
after the approval step use Lookup record step on sys_journal_field with query like this and grab the Value column which gives you the text entered
Element ID = sysapproval_approver record sysid
Then use the output from this step and do whatever you need to do as per business requirement
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The rejection comment (intended for the widget displayed on the portal) was recorded in the "Comments" field of the Requested Item record (where the name is `sc_req_item`).
Additionally, when I attempted to set a filter targeting the "Element" field within a flow action, a message appeared stating that the "Element" field is not supported, preventing me from using it.
As a workaround, I tried setting only the filter conditions for the "Look Up Record" action via a script, but this was unsuccessful.
The following error occurred:
"GlideRecord.setTableName - empty table name"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
another workaround
1) create a flow variable of type string
2) after approval step use "Set Flow variables" flow logic and use GlideRecord to grab the value and set in that flow variable
3) then use the flow variable which now holds the exact value
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader