Get in argument name

I am playing around with some error handling on accessing and downloading a sharepoint file and I have the following arguments:

I create a list and add all of these arguments to said list:

Later, I use a for each through each of these arguments in the list and check if their value is still the default value set. If so, it adds each variable with an error to an exception list:

This list is then concatenated at the end and printed out, however the list prints the error variable contents, how can I get it to print the name?

My code for this:

The resulting string:

An example of what I want this to be:
Required argument in_SharepointAppID has default value still set. Please make sure this value is being assigned an input argument.

@phaynes

Instead of list and variables separately…use dictionary…that way key will be the name and value will be the value you need

You cannot directly print a variable name…where you are passing only value in list and not the name

Cheers

Why don’t you just take the default values out and make the arguments required? This will force them to fill in those arguments.

Completely forgot this was even something I could do. This is my solution.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.