Flow Designer inline scripting error

runfast
Kilo Guru

I am trying to update a field on a CI form based on the current value using fd.data object, but I am getting an error:

"Flow Designer: attempting to use undefined input = 'current' from Append Comment: no thrown error"

 

var today = new Date().toLocaleDateString();
var shortDesc = fd_data.trigger.current.short_description;
shortDesc = shortDesc + "/n" + " ---Good bye " + today;

 

I did see a similar issue where "current" is not available under subflows, but I am getting the same error when using it under the main Flows.,

Any directions OR guidance greatly appreciated.

thanks

1 ACCEPTED SOLUTION

Hey James - Thank you for calling out the missing ingredient.

I was not using Insert/Update under the trigger section of the flow. Once I changed the trigger to insert, it works like a charm.

 

Thank you again!

 

thank you

View solution in original post

4 REPLIES 4

AJ-TechTrek
Giga Sage
Giga Sage

Hi @runfast ,

 

there are couple of solved articles available, Refer those , that might help you.

 

https://www.servicenow.com/community/developer-forum/error-attempting-to-use-undefined-input-current...

 

https://www.servicenow.com/community/itsm-forum/attempting-to-use-undefined-input-current-from-check...

 

https://www.servicenow.com/community/developer-forum/need-help-flow-designer-script-error-quot-attem...

 

https://www.servicenow.com/community/%E9%96%8B%E7%99%BA%E8%80%85%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A9...

 

https://www.servicenow.com/community/itsm-forum/flow-designer-script-error-quot-attempting-to-use-un...

 

Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.

 

Thanks

AJ

Linkedin Profile:- https://www.linkedin.com/in/ajay-kumar-66a91385/

ServiceNow Community Rising Star 2024

Thanks Ajay for providing these useful links. I already removed some of these articles, but I will make sure I am not missing anything. 

James Chun
Kilo Patron

Hey @runfast,

 

What is the trigger for your Flow?

I think you should be able to use the 'current' object if the trigger is 'created', 'updated', or 'create or updated'.

 

Cheers

 

Hey James - Thank you for calling out the missing ingredient.

I was not using Insert/Update under the trigger section of the flow. Once I changed the trigger to insert, it works like a charm.

 

Thank you again!

 

thank you