I am working on an automation that loops through a dataRowProxy.ItemArray. Some items in the array may return a null value from the stored procedure query. I have attached an image that displays the GetItem method using the data column name. I right-clicked on the Result connection point and selected Create Instance. I did not get the Choose Method Overload as shown in Pega Help. I am trying not to use a second GetItem to set the value for the variable after checking for null. Is the structure in the attachment correct?
@DarrellE I believe you want to create a proxy there instead of creating a new instance of that object. In this case, your GetItem returns an object. You might need to cast it. The way to do that in an automation is to use a Jump Label. Add a parameter to the JL of the type you want. Pass the result from GetItem to it and then off of the JL, you can extract a proxy and the object will be the correct type.
@ThomasSasnett How do I set a string variable to an empty string? Do I just use the string variable’s ResetState method? Some of the columns have decimal values stored as a varchar data type because leading and trailing zeroes are significant to the mainframe system where the data is loaded. The variable may have a value from the previous row while the same column of the current row may not contain a value. I suppose I could use the Remove method with a start index of 0.
@DarrellE To set a variable to an empty string, just click into the value property in your automation and click out. It will grey out the blue dot on the left and the value will now display “Value:”. If you check that, it will be an empty string.
@DarrellE Incidentally, ResetState should reset the variable back to whatever you had in the string’s Value property. By default, that is an empty string, but you could be initializing it with some other value, so I would just do the click-in and click-out method.