Hi Everyone,
I want to write a condition for below description to compare two value -
a variable name - strJobCode where int value is stored like- 0057 and second vaibale name strJobCode2 where also int value is stored - 0078 and now bot needs to search take strJobCode value and search it in a sheet in column A and get the value from column C and this sheet’s URL is written in the Reframework config file (in" Setting"sheet) and afetr searching if column C value is “Y” and now check strJobCode2 value and search it in the same sheet where first code is searched. and if it has “N” then it should consider “TRUE”
and Vice versa means -
check strJobCode where int value is stored like- 0057 and second vaibale name strJobCode2 where also int value is stored - 0078 and now bot needs to search take strJobCode value and search it in a sheet in column A and get the value from column C and this sheet’s URL is written in the Reframework config file (in" Setting"sheet) and afetr searching if column C value is “Y” and now check strJobCode2 value and search it in the same sheet where first code is searched. and if it has “N” then it should consider “TRUE”
Please suggest the correct logic which I can write in assign value section.
Hie @Preety_Choudhary you mean first int variable value should be equal to column A and then it should be checked with intvar2 ?? if no then i"m sending you a logic …
Try reading Config Sheet and do Lookup Datatable for searching the given codes present in the Excel and if value is present it will output and if not it will give empty. Based on the output values use the IF statement compare “TRUE” OR “FALSE”
Check the below workflow for your better understanding,
→ Use the Read range workbook activity to read the Excel and store in a datatable called DT.
→ The variables strJobCode and strJobCode2 have assigned the values as below,
→ Then create a boolean datatype variable called Bool_Result. Then give the below LINQ Expression which has conditions as per your requirement in assign activity,
If the strJobCode is in ColumnA and ColumnC equals to Y and also strJobCode2 is in ColumnA and ColumnC equals to N then the Bool_Result will True else it will give False as output.
Note: Change the ColumnA and ColumnC name in the Expression as per your Column names.
Thank you for the solution. However I would like to clear on thing that I am using Reframework for this and The excel file’s is stored in the config sheet in setting name sheet. so how will I write the condition? I will have to use config sheet to get the excel url and after that that sheet will open and search the job code in column A and check the value in column C that is “Y” or “N” and like this It will copare both the Job code value and If either of them is “Y” then it will be considered “TRUE”
I am a bit confuse that how to use condition for this means to use config file and after searching the jobcodes.
Please help me on this If You can.
Thank you Very much.
I mentioned in the above post to use the Read range workbook activity right… @Preety_Choudhary
In that read range workbook activity you have to give the excel path and sheet name. In your case the excel path and sheet name is stored in config file right.
Let’s say the Excel path key name as ExcelPathName and sheet name key as ExcelSheetName. In the read range workbook activity in the file path field give Config(“ExcelPathName”).toString and in the sheet name field Config(“ExcelSheetName”).toString.
Then the read range workbook activity will read the excel that you have mentioned in the Config file. After read range use the assign activities and linq expression to get the required result.
I am not using DT for this so how can I put that LINQ condition here. didn’t get this.
scenario-
“strWdJobCode”- variable for workday sheet- firstly bot wiil get the job from here (job code value stored on strWdJobCode- 0017) and now it will open the excel file that’s URL is stored in - “in_config” file with name-“CodeSheet”. Bot will have to now open this URL and then search the job code(0017) in column “A” and check the value in Column “c” where value is wriiten In “Y” or “N”. and If against this job code value is “N” in column “c”
Now, it will check secong Jobcode value which is stored in an arg- “in_ghireJobcode”(0145) and
now it will open the excel file that’s URL is stored in - “in_config” file with name-“CodeSheet”. Bot will have to now open this URL and then search the job code(0145) in column “A” and check the value in Column “c” where value is wriiten In “Y” or “N” and If against this job code value is “Y” then It should consider “TRUE” and vice versa.
so could u please give me the condition as per this scenario, like u have mentioned about LINQ but what do I need to put in place of DT as i am using this sheet via config so.