How to assign Row Count to a Variable default value VB Expression

Hi Team,

I need to assign Row count to a variable through default VB expression.

is there anyway to assign value directly ?

I am able to assign through assign activity but it ll be good if i can directly add the value through default expression .

Thanks in Advance
Lenin KR

Hi @Leninkraj

You should be able to do that through teh default value option. However, the syntax of the expression you have used seems to be bit wrong :slight_smile:

You are missing a dot (.) after Rows. So it should be
ContentLinks.Rows.Count

1 Like

Hi Lahiru,

i tried putting dot after Rows but i am getting below error

image

pls help

@Leninkraj

You have to initialize your data table

New DataTable()
image

However, I would not recommend to use this approach. The reason for me to say that is, at the time of initiating this workflow, by deault the rows of the datatable will be set to 0 (unless you are passing a datatable through arguments). So in that case, at the initiation, your variable will also get assigned with 0. This value will not change automatically later even though you add data to the data table within the workflow. You will anyway have to use a assign activity to get the latest row count into the variable.

So the best way would be to use the assign activity to get it. it will be a more accurate way of doing it…

2 Likes

Thanks Bro :slight_smile:

1 Like

No worries bro… I’m always here to help!! :smiley:

1 Like

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