cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
garethaw
Helper III
Helper III

Provided value is of type object when using get file content (sharepoint)?

Hi,

 

Please can you help I have been following a tutorial that converts csv to json and then edits some values.

 

The flow was working well until I changed the get file content from OneDrive to SharePoint.

 

For some reason when I use get file content SharePoint I get the following error:

 

Unable to process template language expressions in action 'splitByLines' inputs at line '0' and column '0': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Object'. Please see https://aka.ms/logicexpressions#split for usage details.'.

 

garethaw_0-1646211516686.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Dual Super User
Dual Super User

Hi @garethaw,

 

Sorry, I misread. I thought you said you changed it from SharePoint Online to Onedrive for Business. But it is the other way around. My bad 😅

 

In that case you want to retrieve the $content property. However, that contains a base 64 string instead of just string data like in the OneDrive one. You can use a base64tostring function before you split it.

 

 

split(base64tostring(body('Get_file_content')['$content']), outputs('newLine'))

 

difference_betweenfilecontent.png

 

 

 

View solution in original post

4 REPLIES 4
Expiscornovus
Dual Super User
Dual Super User

Hi @garethaw,

 

What expression are you using in the splitbyLines compose action?

 

Have you tried this expression:

split(body('Get_file_content'), outputs('newLine'))

Hi, The expression I'm using is:

split(outputs('Get_file_content')?['body'], outputs('newLine'))
 
I have tried using the expression you provided but get the same error:
 
garethaw_0-1646214475028.png

 

Expiscornovus
Dual Super User
Dual Super User

Hi @garethaw,

 

Sorry, I misread. I thought you said you changed it from SharePoint Online to Onedrive for Business. But it is the other way around. My bad 😅

 

In that case you want to retrieve the $content property. However, that contains a base 64 string instead of just string data like in the OneDrive one. You can use a base64tostring function before you split it.

 

 

split(base64tostring(body('Get_file_content')['$content']), outputs('newLine'))

 

difference_betweenfilecontent.png

 

 

 

Marvellous, thanks very much

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,188)