I have a simple 2 step flow. I'm sending an http request from a website to create a SharePoint list item. It's been working great for several months, but it failed for the first time today with this error:
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.'.
The HTTP request outputs several strings and some null values to a SharePoint create item step. Looking at the raw data everything looks okay to me. Nothing unexpected. My understanding is that error states there was a failure trying to convert a string to an INT. There is only one Expression using that function in my Create Item step which is for the Donation amount.
In this case it's null though since it was not a donation. On the SharePoint list these columns are all "Single line of text" aside from the Details which is "Multiple lines of text". This is what my JSON body looks like with some minor changes to protect the innocent:
"body": {
"EntryID": "11539",
"DonationDate": "",
"Name": "Something's Here",
"Breed": "belgian",
"Discipline": "102 - Draft",
"Sex": "Male",
"Color": "Blonde",
"DonationAmount": "",
"DonatedByFirst": "",
"DonatedByLast": "",
"DonorPhone": "",
"DonorMailingAddressStreet": "",
"DonorMailingAddressLn2": "",
"DonorMailingAddressCity": "",
"DonorMailingAddressState": "",
"DonorMailingAddressZip": "",
"Details": "Purchased 6/17/22 at the a special place",
"Inv#": "2765",
"Reg#": "S74775"
}
}
Solved! Go to Solution.
Added some logic to make sure it sends a null value to SharePoint when those values are empty. That fixed it.
Interestingly I just found that if I remove that INT expression for DonationDate I get this error for the same data above where DonationDate is null. It is not a required field on the SharePoint list.
The 'inputs.parameters' of workflow operation 'Create_item' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/DonationDate' is required to be of type 'String/date'. The runtime value '""' to be converted doesn't have the expected format 'String/date'.
Added some logic to make sure it sends a null value to SharePoint when those values are empty. That fixed it.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
5 | |
4 | |
3 | |
2 | |
2 |
User | Count |
---|---|
14 | |
11 | |
8 | |
6 | |
6 |