Hi All, I need to extract File names from a CRM website and enter the details in another website. So I have used For each Ui element as all the file names are present in a single field in CRM and later I have used Get attribute activity to capture the data in a variable and AAname is selected. Now I need to select a particular file name only (for example. if the file name contains “Year 10”) to enter into a type into activity! Is there any code that selects specific data which can be used to enter into type into activity ?
You need to use if condition
In that filename contains “year 10”
Then pass that variable in the type into activity
Hope this helps
It sounds like you’d be better of using Table Extraction to get all the data into a datatable, then Filter Data Table to keep only the values you want, then For Each through the remaining rows of the datatable and enter into the web site.
Below the get attribute use if condition
condition
Filenames.equals(“Year 10”) or Filenames.Contains(“Year 10”)
Then
inside of then use type into activity pass the variable as filenames
hope this helps
unfortunately, it didn’t work maybe because the get attribute activity and if condition is in different use application activity
No problem you can use classic type for that in place of modern
Or else
Fine tune the use application activity of type into
Can you share the value of the filename which you are getting
Have fine tuned the selector
If fine tuned can you please share the both use browser selector which you are using
I get the values in this way,the name keeps changing but the word “Year 10” exists. I didn’t u understand the term fine-tuned, can you please elaborate, I am a beginner to UiPath
Can you use another assign
Above if activity
Newvariable=path.getfilenamewithoutextension(filenames)
Gives you the output as
Vidya sami year 10
Use newvariable in the if condition
Like
newvariable.contains(“year 10”)
I am getting this as the output for newvariable and the file names are given below which I am extracting
It will give you the file name just without .pdf
You can you that in if
Condition
If it contains moves to then
If it not contains moves to else block
this worked If I create activity like this
Though there are 4 other file names, UiPath is taking only a file name with IELTS
if condition
it will execute only the file name contains IELTS
if you want to execute for all other filenames
please let me know what you are expecting
Hope this helps
it should extract all the filenames and in type into activity , it should type the file name which contains “Year 10”, and for another type into which contains “Year 12” so on
Create array of string like below
arr_str={“Year10”,"Year12,“UG”,“PG”,“IELTS”}
and if condition
use below code
arr_str.Any(Function(x) x.ToString.Contains(newvariable))
it will give true value if there is any value
in then
use Type Into activity
inthat pass newvariable
Hope this helps
placed it above for each uielement but the activity is not getting executed as it is showing an error