Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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?

  • Verified answer
    ChrisRomer Profile Picture
    15 on at
    Re: Why is SharePoint 'Update Item' different between two flows? UPDATE: (100% certain there are 2 versions of 'Update Item')

    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

     

  • ChrisRomer Profile Picture
    15 on at
    Re: Why is SharePoint 'Update Item' different between two flows?

    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

     

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Re: Why is SharePoint 'Update Item' different between two flows?

    @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

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow