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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard