How to extract values from excel?

I have to develop a code which runs perfectly for both test system and PROD envi but
test system has below status:
Status: active, finished, canceled, released
PROD has below status:
Status: active, finished, canceled

Now how I want to proceed for both:

In test system:
I want to get all jobs as finished status as =100% but meanwhile ignoring released jobs (which is only in test system). Here also even if one job is cancelled or Active I am not supposed to move ahead.
In prod:
I want to get all jobs with finished status as =100% then only want my bot to proceed
even if one job s active/ cancelled I dunn want to move ahead

How can I develop one code which works fine for both the test and prod envi?

image

Extension of this topic

1 Like

Thanks for your updates. I also want to know more about it.

?? What would u want more if u can elaborate. I’ve been as elaborative as I could have been

One way to approach it:

  • Provide an input file containing the user names of the test bots and save them on a list variable
  • Compare if the current user exists in the input list for example:
    if My_List.Contains(Environment.UserName)
  • If the condition is true, then it means you’re on test environment

Another way:

  • Create an asset on both environments that have a variable to check if it needs to run the released status
    TEST - Asset Name: ProcessReleased Value: True
    PROD - Asset Name: ProcessReleased Value: False

there are several techniques like forking logic driven by assets or main job input parameters.

Also have a look at the Datatable.Select method. Maybe a Search expression different to the particular environment can do the job

https://www.csharp-examples.net/dataview-rowfilter/

If you can help little bit more, as I need that urgently

@Yoichi If you can further assist here?

HI, I am not asking for this:

I am asking to put a query for DT where I can filter the data I want as mentioned in query

just let us summarize the case

in test: get the count for finished, but ignore released
in prod: get the count for finished

is this correct?

so lets rewrite the check logic (one of your previous topics) to

Variable:
filterValues | List(Of String) = … having the values according the environments

And the checker LINQ we can rewrite to

((From d in YourDataTableVar.AsEnumerable
Let st = d("Status").toString.Trim.ToUpper
Where filterValues.Contains(st)
Select r =d).Count / YourDataTableVar.Rows.Count) < yourLimitVar

As menitoned above. with an asset (controlled by the environment) or a Job Input argument you can control the population of the filterValues list values

1 Like

Thank you so much :slight_smile:

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