I am struggling to get the some failed part in Email. Can someone help me to get this ?
(1) I want to process some data from Excel File through Website.
EX: Row 1 is success on WEb. Row 2 and 3 is failed to process on Web. Continue untill last row.
(2) I want to get all failed Row item from Ex: Column 1 (1234) in the email body at last to send the user that these is the failed numbers.
Itâs better if you can share a sample excel file how the data is arranged
If you want the failed rows from excel then you can use filter datatable activity
Use Read Range activity to read the excel and declare a variable which is datatable, let say dtexceldetails
Now use Filter datatable activity and give column which is the failed Letâs say âColumn2â = âFailedâ-> This should be exactly the same as the row has
you can use Write range activity to write the filtered data to another excel
Now you can use send outlook message activity to send the email
I am guessing youâre processing each row with the help of for loop. Please follow below steps to achieve the same.
Use the âBuild data tableâ activity before for loop and add headers. We will store failed rows in this data table. Letâs name it Failed_DT.
Use Try block Inside âfor each row in data tableâ. Keep your code inside the try block only.
Now write your code to process the row in the website. In case of success, update the status in the same table. Use the 'throw â activity to raise business/system exceptions in case of failure.
In the cache block, Create a business rule exception handler and inside that use âadd row itemâ and add the current row to Failed_DT.
After completion of for loop, write the Failed_DT data to email and send it to whoever you want.
Let me know, if you have any further doubts on the same.
Hey , @Ashutosh.Gupta Looks like these is what I want. Few questions still.
I am finding Row 1 from Excel on Website if it founds then process further if not then It is the failed .
Same way other conditions also if found and failed in the middle of the web process that is also failed.
So in this scenario , Do I need to use throw activity and catch block for the failed one ? Because I have to use IF condition to check some conditions if available , If available then matching the value ?
Yes. Inside every if condition you can add throw activity for failed situations. In case of failure, the transaction will automatically go to cache. Then it will update the failed DT and then proceed with the next transaction in the loop.
Add column to the excel file name as âStatusâ
Use âFor each excel rowâ activity to Iterate the excel rows, fetch data and use data in the website.
If the data in the web is success then use âWrite cellâ activity to update the status as âSuccessâ in the excel.
If the data in the web is failed then update the status as âFailedâ in the excel.
After first For each row in excel activity add one more For each row excel activity to iterate the updated excel file.
Inside the loop take a âIfâ activity to check the status = failed then send a mail in the else block.
@Ashutosh.Gupta@mkankatala Can you provide me an sample file ? Also Putting different conditions to catch failures so how Can I get those data into data row ?