cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate I
Advocate I

Updating Single Field in the SharePoint List using flow

Hi,

 

I am using SharePoint Update Item and want to update single field in the list. I am setting value for the mandatory field and the single field that I want to update leaving other fields untouched.

 

However, when the flow executes it clears all the other fields in the list for which I have not provided the value.

 

Quick looking at a code view I noticed that it's passing empty values for the other fields, can I update the code view in flow to fix the issue ? Is there other fix available for this ?

 

flow issue 2.pngflow issue 1.png

 

9 REPLIES 9
Super User III
Super User III

@imran7799 :

 

Are all of the fields being cleared out either choice or lookup columns?

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Thanks for the reply @ScottShearer .

 

They all are single line of text. After you replied, I reviewed all the columns in the list and looks like this is hapening only with all the "Single line of text" columns.

 

I have other types of fields in the list (Multi line text, date, person etc.) but they are not loosing their values.

 

 

Super User III
Super User III

@imran7799 :

 

I don't see why this may be happening to you - it should not be. 

As a work around, put a Get Item action before the Update Item action.  Then, supply values for Get Item Dynamic Properties for those columns that are being cleared.

 

Sorry I don't have any better ideas.

 

Scott 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

That’s what I have done for now. Wanted to see if there is any better solution to this issue.

Hi, did you find a solution? I only have 1 field I want to update within the list. I am tentative to test my flow because I do not want to lose my list data. 

I have the same issue and my list have some choice fields, which is showing their default values rather than the list value. I didn't test the flow since I don't want to overwrite the data. Will have to test it with some dummy data to see if the default values are getting overwritten on those fields.

I'm not sure that this is still an issue for you. I did find that for every SharePoint field that had a default value, that the Update Item step would default to that value. If I deleted the value while editing the PA Update Item, the description text would appear in the GUI and if I peeked at the code, the field would no longer be listed in the update action.

Frequent Visitor

One solution for this that works perfectly for me is to first make a custom view for the list in SharePoint and only select those object fields that you want to change. After that use the advanced options for the Update object action in Power Automate and select the SharePoint list view that you just created. In this way, only the fields in the view gets updated. Sorry for the Swedish version, but I hope its understandable (“Koordinater” is my custom view).

Rundblad_1-1607355375471.png

 

Rundblad_2-1607355375475.png

 

Frequent Visitor

UPDATE (latest): from the looks of it, the SharePoint action "Update item" now only updates the columns/properties which have a new value assigned. Still be aware for the those columns with a default value, as the set value might be reset to the default! Either use an empty value for the "Enter custom value" option or leave this(/these) column(s) out in a dedicated update view which you can select in "Limit Columns by View" advanced option of the Update item action.

 

As an alternative you could use the 'dynamic' version of Update Item, where you specify a Compose/variable value in the Site URL field (and List Name). As the Update Item action can't determine which content type is to be used, it provides next to the Id field also a Item field. In the latter you can provide key/value (JSON) pairs within curly brackets:

JPMHuls_0-1609952851898.png

However, it may prove a challenge to update certain data types this way...

 

UPDATE: for a person/group (single, resp. multi value) it would look like this:

 

  "Requestor": { 
      "Claims": "@{triggerOutputs()?['body/Author/Claims']}" 
  }, 
  "TestPersons": [ 
      { 
        "Claims": "@outputs('Get_item')?['body/Author/Claims']", 
        "Claims": "@outputs('Get_item')?['body/Editor/Claims']" 
      } 
  ]

 

 

Hopefully this help.

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (11,967)