Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Use GlideRecord() in function field

MiY
Tera Contributor

Hi team,
I want to use GlideRecord() method in function definition field because need to query other table and get specific field value.

Detail requirements follows;

Create a field 1 (<-function field) in table A.

I want to set field 1 to part of table B's field 2.

table A is referenced by table B's field 3.

 

Can I build this function?

Please help me.

 

Regards,

 

15 REPLIES 15

@MiY 

Hope you are doing good.

Did my reply answer your question?

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

@Ankur Bawiskar -san,

 

Thank you for your reply.

My ultimate goal is to use AWS AppFlow to link data from ServiceNow Table A with Table B's creation date.
I created a database view, but I was unable to select it in AWS AppFlow.
Therefore, as shown above, I need to create a field in Table A to display the creation date of Table B and display it.
I think I can meet the requirement by creating a business rule, but this table is already in production.
Therefore, the field will be empty for records created before this implementation.
To set a value in the field, I need to update the created records as a developer.
I think this should be avoided from a security perspective.
If the requirement could be met with a function field, the value would automatically be reflected in the field of the created record.
Therefore, if possible, I would like to achieve the requirement with a function field.
Is there a good way to do this? Please help!

 

Regards,

 

@MiY 

not possible.

If you are planning to use a new field then you can populate that with a fix script after you migrate your update set.

Then this field will have data in it.

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

@MiY 

Hope you are doing good.

Did my reply answer your question?

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

@MiY 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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