power automate - read text file: "Variable %FileContents% must be list" - text

I have a txt file that I would like to parse in Power Automate. In a youtube tutorial, the instructor stores the content as single text value. However, when I select this, an error is returned
Variable FileContents must be a list, datatable, or datarow. Why is this happening?

Related

SSIS: failed to retrieve long data / truncation errors

I'm getting either of those two errors when trying to export data from a set of excel spreadsheets.
Simplified scenario:
two excel spreadsheets containing 1 text column
in file 1 the text is never longer than 200 characters
in the 2nd - it is.
SSIS suppose to import them automatically from a folder - easy and simple, but...
Excel source component decides what data type is used here.
When, using created by me sample file with sample text data, it decides to use DT_WSTR(255) it fails with the second file with the truncation error.
When I force it to use DT_NTEXT (by creating longer text in the sample file) if fails with the 1st file complaining that "Failed to retrieve long data for column"... because the 1st file doesn't contain longer texts...
Has anybody found a solution/work-around for this? I mean - except manually changing the source data?
Any help much appreciated.
We can use Flat File Connection Manager instead of Excel Connection Manager. When we create Flat File Connection Manager we can set data type and length explicitly. To do so first we need to save the excel file as csv file or tab delimited file. Then we can use this file to create Flat File Connection. Drag and drop a Flat File Source in the Data Flow tab. In the Flat File Source Editor dialog box click New button and it will launches Flat File Connection Manager Editor dialog box. In the General tab specify the file full path and click Advanced tab. Then put data type and column width like below image.
Click OK and close the dialog box, this will create our connection manager. Now the connection manager can successfully read the full length data but we have to set the data type & length of the Output Columns so that we can get the data in the output pipeline. To do that right click on the Flat File Source and click Show Advanced Editor option. Then follow the below image instruction.
When we finish we run our package and it run successfully without any truncation error and insert all the data in our target database.

How to get Text & data scraping and insert into excel together in UIPath

Is anyone know how to use get text & data scraping together and insert into Excel?
What I want to show in my Excel is those highlighted in Blue, i was able to get the datatable using Data Scraping but i cant get the “104445” together.
What you have is a combination of tabular data in your PDF, and property-type data where the information comes in name-value pairs.
Is anyone know how to use get text & data scraping together and insert into Excel?
You've got the first part working. Now just add new activities to your process or workflow that will extract the text after the tabular data is extracted. Hold the specific data fields in variables, and then just use the Excel activities to write the DataTable and information held in variables into the spreadsheet. Append Range and Write Cell Excel activities will likely do the trick.
Table data vs name-value pairs
The UiPath data scraping functions are perfect for the tabular data. As you have discovered, it brings everything back as a DataTable. The individual pieces of data require more fine grained data extraction.
For the 104445, you will need to use the get Text function, in combination with the Anchor Base function.
You add the Anchor Base function onto the page. The Anchor Base requires two activities to be added in order for it to work.
The first activity is a get Element. This will specify the label to the left of 104445.
Then you add a get Textactivity to retrieve the text next to the get Element activity. This will extract the 104445.
You then hold the result in a String variable and use it as you like.
Anchor Base Activity Example
In the following UiPath Anchor Base example, the label is above the text I want to extract so the Anchor Base activity sets the anchor location to be above the text to extract. In your example, you would set the UiPath Anchor Base activity to indicate that the anchor is to the left of the text to extract.
By the way, you can use the PDF get Text activity alone without the Anchor Base activity, but it likely won't work if you need to extract data from multiple PDFs, as the UiPath selector will be too specific. If you need to loop through multiple PDF files, you'll want to use the Anchor Base activity.
Tagged PDFs only
Just a note to anyone else looking at this answer. For the data scraping and get text activities to work, the PDF must be tagged. If the properties indicate that PDF is not tagged, these features will not always work as advertised. Furthermore, if the PDF is really just a scanned image, you will need to use UiPath OCR facilities. The data scraping and get text activities won't work at all.
Also, in order to get the data scraping or get text activities to work propertly, you many need to change the reading order property of the Adobe or FoxIt reader to infer or tagged.

Access data can't be imported to excel

I am trying to import/export a cell in/to Access. This cell is where my coworkers can input their comments (Cell B29).
Here is the coding I write for exporting the data:
rs.Fields("CustomNotes") = Sheets("Main").Range("CUSTOMNOTES")
When I save the data into database, the contents in the cell were successfully saved into the database - in a column with long text.
However, when I read the data from the database, the cell is empty and doesn't show anything. Here is the code i write for importing data:
Sheets("Main").Range("CUSTOMNOTES") = rsl![CustomNotes]
When I do the debugging, rsl![CustomNotes] shows object required..
Can someone please help here? Do I need to add any definition or my variable type is wrong?
Every time I have seen a problem like this, it was related to the field being a Long Text/Memo field and changing the field type to Short Text has fixed it. Excel has problems with Long Text in some cases.
The main difference between a Short Text and a Long Text field is simply the number of characters can hold (256). They both can store alpha and numeric characters.
Other limitations for Short Text are that it cannot hold Rich Text information, whereas Long Text can. If you are using Short Text and need special formatting done, you will need to do that in code instead after you retrieve the data.

Looking up multiple values in a list

I'm trying to select multiple values based on a search key. In it's most basic form there is no problem with this. I followed this example and everything went well:
http://office.microsoft.com/en-us/excel-help/how-to-look-up-a-value-in-a-list-and-return-multiple-corresponding-values-HA001226038.aspx
=IF(ISERROR(INDEX($A$1:$B$7,SMALL(IF($A$1:$A$7=$A$10,ROW($A$1:$A$7)),ROW(1:1)),2)),"",INDEX($A$1:$B$7,SMALL(IF($A$1:$A$7=$A$10,ROW($A$1:$A$7)),ROW(1:1)),2))
The problem with this however is that in my case I have multiple CSV files (external) where some values in my A$ column look like this:
=- sometext // results into #NAME? error
Excel interprets these as a formulas where it is actually only supposed to be a string. Sure I could change it to text and save it again but I would like to avoid any manipulation in these CSV files.
I tried to extend the second IF statement (if you read it from left to right) with:
IF(AND($A$1:$A$7 <> "#NAME?", $A$1:$A$7=$A$10,ROW($A$1:$A$7)))
and
IF(AND(NOT(ISERROR($A$1:$A$7)), $A$1:$A$7=$A$10,ROW($A$1:$A$7)))
Both didn't work. (Sorry if I messed up some syntax and formula names, I'm using a different language version)
Here a small image of what's happening right now and how it should look:
On the right site you can see a list of values right next to Test1 which are missing on the left site due to the #NAME? error.
I would suggest opening the csv's files as text files. Selecting Comma as your delimiter and then select Text as your Column data format. This way, Excel will treat all your data as text and will not try to read =- sometext as a formula.
To do so, you would need to change your .csv files extension to .txt or anything else (even no file format).
Instead of "Opening" the CSV file, you can "Import" it. This will open the Text Import Wizard which will allow you to specify particular columns as Text. This is located in different areas in different versions of Excel. In Excel 2007, it is on the Data Tab / Get External Data / From Text. The example below demonstrates bringing in long numbers, but it should work just as well with your formula "lookalikes"

sharepoint web service does not store data in one column of list

I try to write some data to a list column using sharepoint web service. The column is single line of text. The text I want to write into the column is an xml text. For example
But sharepoint did not store it; other plain text seems to work.
Do I need to replace xml tags with some code, for example: > is ">"
I did just that, but still is not working.
What am I doin wrong?

Resources