flow designer update work_note

Chang Shuang
Tera Contributor

Hi All,


I want to create a approval flow designer and want to update work notes when approved.
in the work notes I want update like this: {approver}+当インシデントは却下されました。
{approver} is refer to the approver who approved this request.

ChangShuang_0-1696925828762.png

How can I make this, variables in text.

Thanks a lot.

 

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Chang Shuang 

you need to use f(x) inline script and use this.

you can click this icon and write the script

AnkurBawiskar_0-1696926324075.png

 

var sysId = fd_data.trigger.current.sys_id;
		var gr = new GlideRecord("sysapproval_approver");
		gr.addQuery('sysapproval', sysId).addOrCondition('document_id', sysId);
		gr.addQuery("state", "approved");
		gr.query();
		if (gr.next()) {
			return gr.approver.name + ' your message here';
		}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Chang Shuang 

you need to use f(x) inline script and use this.

you can click this icon and write the script

AnkurBawiskar_0-1696926324075.png

 

var sysId = fd_data.trigger.current.sys_id;
		var gr = new GlideRecord("sysapproval_approver");
		gr.addQuery('sysapproval', sysId).addOrCondition('document_id', sysId);
		gr.addQuery("state", "approved");
		gr.query();
		if (gr.next()) {
			return gr.approver.name + ' your message here';
		}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur, 
Thanks you very much.
You support me many times ,

Appreciate~

Anil Lande
Kilo Patron

Hi,

You have to use LookUp Action to get Approval Record related with your ticket and use the data pill to get Approver name from the previous action. If you have only one approver configured then you can dot walk on previous approval action to get approver name.

Please let us know your current configuration and how many approvals you have? 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande