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 / Error when creating a ...
Power Automate
Unanswered

Error when creating a SharePoint list item - field w/o value

(0) ShareShare
ReportReport
Posted on by 2

Hi Everyone,

 

I am trying to create a new SP list item based on another item in another list using HTTP request.

 

My problem is with assigning a value to a number field. If the source field (also number type) has a value everything works fine but if the source field is empty then I get the following error:

 

"Cannot convert a primitive value to the expected type 'Edm.Double'. See the inner exception for more details."

 

First I thougth that the problem was the formula as I'm using double quotes around the value I'm trying to assign

but if I remove the double quotes I get a different error message:

 

"Invalid JSON. An unexpected comma was found in scope 'Property'. A comma is only valid between properties of an object or between elements of an array."

 

Then I tried converting the value to integer using an expression with int() function but that also didn't work.

 

"The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type."

 

Is there any soution to my problem besides setting 0 as the default value for the field or using Single line of text type instead of Number?

 

Thank you in advance.

 

Regards,

Peter

Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    You can have an expression that checks if the property is empty, and if so, use null, otherwise (if not empty), use the value of the property. See example below:

     

    if(empty(string(outputs('Compose')?['Amount'])), null, outputs('Compose')?['Amount'])
    
    //You would use your field instead of the Compose
    if(empty(string(YOUR_SHAREPOINT_FIELD)), null, YOUR_SHAREPOINT_FIELD)

     

    In the flow below, the Quantity would be set to null since we don't have an Amount property in our Compose object.

    grantjenkins_0-1673667471981.png


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • Teigler Profile Picture
    2 on at

    Thanks for your response.

     

    I tried above expression but unfortunately it didn't help. I still receive the same error message as before.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 550

#2
Valantis Profile Picture

Valantis 390

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard