Check Excel Sheet Name as a condition using IF Activity

Hi,

I am new to UiPath Studio and I am currently a intern at a local company. If the item is Sheet1 and Sample (Normal Hall) and i will do some necessary stuff and else I know what to do but right now I having problem for this:


Thanks!

Hi,

In your excel application scope add the path like this “C:\anypath\filename.xlsx”, and also

to check the if use and instead && . also for == use = instead of ==

item.tostring=“string” and item.tostring=“Sample(normal Hall)”

let us know if this helps.
Regards,
Pavan H

1 Like

@pavanh003 hi sir thanks for your reply! For my workplace they want create a excel file dynamically so as you can see the excel application scope the file path. For the if condition I must type like how because I need to filter out Sheet1 and Sample Hall so I type like item==???

Hi,
item.tostring.equals(your checking variable) or item.tostring = (your search string with double quote).

Let us know if this helps,
Regards,
Pavan H

2 Likes

@pavanh003 so something like this item.ToString.Equals(“Sheet1”, “Sample Hall”)?

Hi,
item.tostring.equals(“Sheet1”) and item.tostring.equals(“Sample Hall”)

Let us know if this helps,
Regards,
Pavan H

2 Likes

@pavanh003 hi sir, so one condition can only filter one?

1 Like

Hi,
You can use both conditions if both are necessary in a single condition like I have mentioned in the above post
item.tostring.equals(“Sheet1”) anditem.tostring.equals(“Sample Hall”). Use this condition in a single if.

2 Likes

@pavanh003 hi sir, is working right now! Thanks for your solution!

2 Likes

Hi guys! If you are reading this, for my case need to use or operator to filter one of the condition. Can try and operator but will not work if you want to filter one of the condition. FYI. Happy automate!

1 Like

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