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 / Why is SharePoint 'Upd...
Power Automate
Answered

Why is SharePoint 'Update Item' different between two flows?

(1) ShareShare
ReportReport
Posted on by 15

I've got a number of flows that update a SharePoint list and recently added a date field to the mix. Sometimes the variable I pass to this date field in the Update Item action has a NULL value. Three jobs have no issue with this. I have a job to fix errors on the same list. It also uses Update Item, and crashes with the typical error "... is required to be of type 'String/date'. The runtime value '""' to be converted doesn't have the expected format 'String/date'."

If I look at the output for the flows that are working, they seem to ignore the null field.

 

Stranger, I used Peek Code to view both Update Items in Edit (not flow run output), and the underlying code is different. I appear to have two different Update Item (PatchItem) actions.

The Peek Code on the working one starts out:

 

{
 "inputs": {
 "host": {
 "connection": {
 "name": "@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['shared_sharepointonline']['connectionId']"
 }
 },
 "method": "patch",
 "body": {

 

 

The Peek Code on the broken one starts out:

 

{
 "inputs": {
 "host": {
 "connectionName": "shared_sharepointonline",
 "operationId": "PatchItem",
 "apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline"
 },
 "parameters": {

 

 

Why did this happen, and how do I specify the version that works?

Categories:
I have the same question (0)
  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @ChrisRomer 

     

    You have to use condition which will check whether you date column has value or not. Use one condition action with following logic.

    Date column is not equal to null.

    When this column has value update your item.

     

    Difference in update peak code is due to one which has value and return result and which does not have value so it is  sending you error message from api.

     

    Thanks.

    Hardesh

  • ChrisRomer Profile Picture
    15 on at

    I do use a condition because I also am using formatDateTime, and that will error out on NULL. My point is that both the populated date and NULL variables will run through Update Item in those flows (it's the same variable passed to Update Item, which is not part of the branch logic). If I look at output, the successful flow is simply ignoring the NULL. In my other flow, which is the same list and Update Item, it will crash on NULL.

     

    ChrisRomer_0-1602273393222.png

     

    The code I shared is 'Peek Code' from Edit, not copied from job run output. The action doesn't know what value the variable will hold other than it will be a String.

     

    Here is output. See SCMCERTDATE is blank, and is magically not used in the Output. No error.

    ChrisRomer_0-1602274462087.png

     

  • Verified answer
    ChrisRomer Profile Picture
    15 on at

    I ran across this issue again on flows with null dates, and it was driving me crazy. I tried to copy the 'Update Item' that ignores nulls, but it disables the paste because it 'doesn't match the current flow schema'.

    Fine, I started a new Flow with the working Update Item and copied over the rest of my flow. Here they are side by side. Same flow except the 'Update Item'.

     

    • Left flow uses"operationId""PatchItem" and fails on null
    • Right flow use"method""patch" and ignores null dates



    ChrisRomer_0-1603396665989.png

     

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard