Flow Designer: Unsupported reference: inputs” in Look Up Records condition script while push equipem

manale460681490
Tera Contributor

 

Spoiler

 

Hi everyone,

I’m working in Flow Designer and I’m getting an error when testing my Flow/Action, specifically in a Look Up Records step where I use a Condition Script (encoded query).

 

I’m trying to push records from an “Equipements” table to an external system using a Gateway HTTP POST (pipeline/subject).
So the flow does:

  1. Look up equipment records updated recently

  2. Build the payload

  3. POST to the Gateway endpoint (subject-based URL)

What I’m trying to do

Filter equipment records  in the last X hours, where X comes from an Action input called hours (Integer).

My setup

  • Flow: Scheduled trigger (Daily)

  • Action: “Push Equipements C&R”

  • Action Input: hours (Integer)

  • Step: Look Up Records on table <my_equipment_table>

  • Conditions: Script returning an encoded query

  • Next step: REST (POST) to Gateway with Content-Type like application/vnd.phenix.gateway.binary+json

Script (Conditions)

(function execute() { var h = parseInt(fd_data.inputs.hours, 10); if (isNaN(h) || h <= 0) h = 24; return "sys_updated_on>=javascript&colon;gs.hoursAgoStart(" + h + ")"; })();
 

Error I get

  • Unsupported reference: inputs (from fd_data.action.inputs)
    (or sometimes: Unsupported reference: inputs (from fd_data.inputs.hours))

  • When testing the flow: Could not retrieve snapshot for test using snapshotId ...

 

1 ACCEPTED SOLUTION

J Siva
Kilo Patron

Hi @manale460681490 
Try the below approach. It's working as expected.
Action:

JSiva_0-1768447741588.png

JSiva_1-1768447767029.png

 

Script:

var hours = parseInt(fd_data.action_inputs.hours,10);
if (isNaN(hours) || hours <= 0){
hours =24;
}
return "sys_updated_onRELATIVEGT@hour@ago@"+hours;

 

Regards,
Siva

 

View solution in original post

2 REPLIES 2

J Siva
Kilo Patron

Hi @manale460681490 
Try the below approach. It's working as expected.
Action:

JSiva_0-1768447741588.png

JSiva_1-1768447767029.png

 

Script:

var hours = parseInt(fd_data.action_inputs.hours,10);
if (isNaN(hours) || hours <= 0){
hours =24;
}
return "sys_updated_onRELATIVEGT@hour@ago@"+hours;

 

Regards,
Siva

 

Ankur Bawiskar
Tera Patron

@manale460681490 

what your action is accepting as input?

share some screenshots

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