Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Flow Designer

ada241
Tera Expert

Hi,
I want to copy the name of the company from my form(u_reference1) into the filter condition, but i am having troubles(it keep saying that is undefined). This is my script from the flow designer, the company is a reference and i think i need a strig to be in the filter condition, what should i do?MicrosoftTeams-image (4).pngMicrosoftTeams-image (5).png

1 ACCEPTED SOLUTION

ada241
Tera Expert

Hi everyone, I found the solution, I had to make some changes because fr_data was not working as expected, is a bug that ServiceNow is working on it:

var encodedQuery = 'sys_id='  + fd_data._1__get_catalog_variables.company.sys_id;



View solution in original post

4 REPLIES 4

James Chun
Kilo Patron

Hi @ada241,

 

Try replacing the first line of code with the following:

var companyNamePrefix = fd_data.trigger.request_item.variables.u_reference_1.name.toString();

Cheers

Hi @James Chun 
is not working, still undefined.
I also tried var encodedQuery = 'nameSTARTSWITH' +" " + companyNamePrefix.toString(); ,still undefined

Hi @ada241 ,

 

Try adding '^EQ' at the end of the query. It worked for me.

JamesChun_0-1714084043279.png

JamesChun_1-1714084050859.png

 

 

 

ada241
Tera Expert

Hi everyone, I found the solution, I had to make some changes because fr_data was not working as expected, is a bug that ServiceNow is working on it:

var encodedQuery = 'sys_id='  + fd_data._1__get_catalog_variables.company.sys_id;