I am downloading an excel report and filtering the conditions using linq in Initialization State.When there are no data rows present , it should not proceed to Get Transaction item and should throw exception message “No Data rows present”. In Catch Block where shall I add the exception so that it should not proceed to Get Transaction item if there are no data rows present in file
There one more will be there and modify your conditions
For get transition data you can add exception nothing and your Dt.row’s count <>0 and for this new state you can add your Dt.row count =0
Like this you can add
Or if u do not want to add state
Declare condition in ending step where you will check count and based on that you can add throw
But for this u need to have proper variables declare in a flow where they will have access in this states
Instead of adding one more transition.when there is no row in datatable …I believe you are using a condition in get transaction data to send each row…when there is no row present just assign nothing to transaction item and by default ref will move to end process even if it goes to get transaction data as the process needs to end if there is no data in transaction item as per ref
Actually before Get Transaction Data, In Initialize All Applications, the bot downloads file and then puts some conditions to filter in that file and copies to another sheet called filtered sheet. The Get Transition reads the filtered sheet. If no data rows are found , it should end . But in my case , it goes to Get Transition and does not find the filtered sheet because there was no data rows found in downloaded filtered data table and hence throwing the error.
If there is no filtered conditions, I want the bot should throw exception in initilization all application state after downloading the excel and putting the filter (if no data rows are present)and end process instead of going to Get Transition State
I have put a condition if filtered data table count>0 the proceed with remaining task else throw system exception and then it goes to end process instead of get transaction. This approach is working ,once the bot throws sytem exception in initialization, it ends process.
If it’s working then it’s fine I think. Just document it clearly with all the minor details in annotation. As this is something very customized changes you are doing to REFramework it will be hard to understand to other developer or ourself also after long time that why did I code like this
Yes you are correct. But in my case it is failing in Initialization application itself is there is no data in excel file after filter data table. In Get Transaction it should read the filtered data but since before that itself In iNitialize file there are no data rows , The Get Transaction is unable to read Input sheet
I see you are checking the count after a filter…better to use a filter datatble as most of it are straight forward only or separately filter it in assign and then use output to check…and add some annotations whereever possible