web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to process temp...
Power Automate
Answered

Unable to process template language expressions in action 'Create_item' inputs at line '0' and column '0': 'The template language function 'float' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

(0) ShareShare
ReportReport
Posted on by 3,514

I have the following parsed JSON:-

{
 "?xml": {
 "@version": "1.0",
 "@encoding": "utf-8"
 },
 "RepeaterData": {
 "Version": null,
 "Items": {
 "Item": [
 {
 "ArticleInput": {
 "@type": "System.String",
 "#text": "33333333"
 },
 "ArticleDescription": {
 "@type": "System.String",
 "#text": "desc33333"
 },
 "ArticleReturnable": {
 "@type": "System.String",
 "#text": "YES"
 },
 "Qty": {
 "@type": "System.Double",
 "#text": "1"
 }
 },
 {
 "ArticleInput": {
 "@type": "System.String",
 "#text": "33333333"
 },
 "ArticleDescription": {
 "@type": "System.String",
 "#text": "desc33333"
 },
 "ArticleReturnable": {
 "@type": "System.String",
 "#text": "YES"
 },
 "Qty": {
 "@type": "System.Double",
 "#text": "11"
 }
 }
 ]
 }
 }
}

 

now i want to create a sharepoint list item, and assign the Qty field, so i tried the following formula:-

 

float(items('Apply_to_each_2')?['Qty'])

but i got this error:-

 

Unable to process template language expressions in action 'Create_item' inputs at line '0' and column '0': 'The template language function 'float' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

Categories:
I have the same question (0)
  • Verified answer
    Rhiassuring Profile Picture
    8,692 Moderator on at

    Hi there, 

    It looks like you are trying to apply your float to an Object (Qty), rather than to the "#text" inside of each Qty. 

    I was able to get the Qty text out with this:

     

    float(body('Parse_JSON')?['RepeaterData']?['Items']?['Item'][1]?['Qty']?['#text'])


    (Parse_JSON is because I initialized a variable with your JSON payload, then parsed it, and used that. I selected the "Items" from the parsed JSON into the Compose.)

    You can see that I have a "1" in there - you'd need to do an "Apply to each" on that bad boy with an incremented value.

    I hope that helps.

    Cheers,

    Rhia
  • Paabl00 Profile Picture
    11 on at

    In the event that the error is the same but the field is of type date, which is what should be done??

    Unable to process template language expressions in action 'Create_item' inputs at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

     

    THIS IS THE EXPRESSION

    formatDateTime(addDays('1900-01-01',add(int(item()?[<FIELD NAME>]),-2)),'MM/dd/yyyy')
     
    Please Help

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 386

#2
Valantis Profile Picture

Valantis 342

#3
Haque Profile Picture

Haque 336

Last 30 days Overall leaderboard