Error : Compiler error(s) encountered processing expression "count + 1". 'count' is not declared. It may be inaccessible due to its protection level

I am facing the following when the workflow is publishing in orchestrator. Please helpMain.xaml (42.9 KB)

Compiler error(s) encountered processing expression “count + 1”.
‘count’ is not declared. It may be inaccessible due to its protection level.

count does not exist at the place you are trying the count + 1. I checked the Main.xaml workflow you attached and didn’t see it so it must be in one of your other workflows.

Search “count” in your project and make sure that the variable is showing in the variables window everywhere that you are referencing it.

hi,

Can you verify workflow attached nowMain.xaml (47.6 KB)

  1. Your first issue is duplicate variables.

    count - scope “Flowchart” - default 0
    count - scope “Do While” - no default

    seqno - scope “Flowchart” - default “S502112361”
    seqno - scope “Sequence” - no default

    I think that UiPath is attempting to use the variables with the smaller scope. Since those are the
    ones with no default value when you try count + 1 it throws an error because count doesn’t have a
    value yet.

    Delete the duplicate variables that don’t have defaults.

  2. Assign activity in the loop

    I don’t know if the workflow you shared is your full one, but as it is right now the count assign in the do while loop is doing basically nothing. You’re saying intcount = count + 1 but if count is 0 then intcount will always be 1 for every loop iteration since the value of count isn’t changing.