Use a new record as input in a script

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:

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

I tried but it failed again:

Welcome to the community, @Silvia_Fatti! :smiley: 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.

2 Likes