Help

Re: Use a new record as input in a script

2793 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Silvia_Fatti
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi,
I built below script to use a filed in a new record created as input as project but it doesn’t work and I cannot understand why:
Script error

3 Replies 3

input.config() is not an asynchronous function, so you don’t need to await it’s results.

You can just use this to set your input project:

let project = input.config().Record
Silvia_Fatti
5 - Automation Enthusiast
5 - Automation Enthusiast

I tried but it failed again:

immagine

Welcome to the community, @Silvia_Fatti! :grinning_face_with_big_eyes: The problem now is that you’re calling input.config() more than once per the error in the sidebar. You already have this line that assigns input.config() to a variable (line 4):

let inputConfig = input.config();

All other references to your input variables should be done through that, which means that line 7 should look like this:

let project = inputConfig.Record;

Then again, if you’re only going to use the single Record input variable, you could drop line 4 and only use line 7, which means that you’re still only accessing input.config() one time.

As a side note, it’s preferred to name variables with a lowercase first letter, so I recommend changing “Record” to “record” in your input variable settings.