How to use the InitAllSettings.xaml in C#. HAving issues with the

I’m trying to use the InitAllSettings.xaml in C#, and running into issues with For Each Row implementation of the if assignments.

Add key/Value pair:
to = out_Config(row(“Name”).ToString())
value = row(“Value”)

Both of these statements are giving me the infamous CS0149 “Method name expected error”

Any ideas.

thanks in advance

Sky

1 Like

No worries
Can i have a screenshot of the error in the workflow once
Cheers @Skyman

1 Like

Fine
get the cursor to the blue mark in assign activity
it should be like this as per REFramework
image

Cheers @

not using the REFramework. Just using the same nomenclature for my initallsettings.xaml.
My config.xlsx just has three(3) values in the “Settings” sheet. All three are file locations. So nothing really wild.

The Not String.ISNullOREmpty(…) is not working in C#, hence my just looking at the row to see if is “null”.

I know that this should be something simple.

I’ve been coding in C# for about 15-16 years now. Never run across this type issue before.

thanks, Sky

Have you tried deleting and retyping the fields in the assign activity?

I’ve seen a few issues that UiPath throws a false flag on assign activities.

Several times… :slight_smile: Still no joy

I’m not that experienced in C# syntax, but it’s almost like it thinks you are using row like a method instead of a variable.

What if you use the generic ForEach with TypeArgument DataRow, so it’s like:
For each row In configTable.AsEnumerable()

Note: you can also get rid of the If condition if you integrate linq:
For each row In configTable.AsEnumerable.Where(r => r("name").ToString.Trim != "").ToArray()
or something like that…

Also, do some searches on google if you still can’t figure it out as maybe stackflow has some answers.

Regards.

1 Like

Thanks, I’ll give that a whirl. I did not think about using LINQ.

Still no joy! But I’ll continue working on this until I get it.
I can get the Key> values, but not the values that are associated with the key Name.