Skip to main content

Notifications

Power Automate - Using Flows
Suggested answer

Updating a sharepoint List Item

Posted on by 4
Greetings!
 
Not sure if this is the right forum, but...

I am having a bit of a problem. I have a Sharepoint List where, amongst other fields, a field of multiple "Person or Group" type exists, let us call it fieldA. I have a workflow with a trigger for created or changed item. There is a condition in it where, when reached, must change a simple string field in the item that triggered it.
 
I go and get the item and then try to use the Update Item action. Now my problem starts.
 
I have read, whether it is correct or not, that the update item MUST be given all values which cannot be empty in the list.  And when I try to do my update without setting values for the mandatory fields, I promptly get an error message when I try to save the workflow. However, when I place a reference to the value I got as current for fieldA, it says that I am trying to alter a read only property, DisplayName, even though I am just using the current value.
 
Is there not a way to change just a single field without even trying to touch the others? And if there is not, how do I go around this silliness of it apparently detecting that an equal Person means I am trying to change the DisplayName?
 
 
Thanks!
  • Suggested answer
    David_MA Profile Picture
    David_MA 7,582 on at
    Updating a sharepoint List Item
    You can use an HTTP POST request to update the one field, which will avoid the need to provide information for required fields. This will also help to ensure you do not accidentally enter the wrong value in a field like can happen with the update item action. This is an example that updates two fields: a choice field and multiple lines of plain text:
     
     
    Below is the value to use in the Uri field. Be sure to update "Display Name of the List" with the name of your list.
    _api/web/lists/getByTitle('Display Name of List')/items(@{triggerOutputs()?['body/ID']})/validateUpdateListItem
    And here is an example of the JSON body, which will vary depending on how many fields you want to update and the type of field. For the Fieldname value, you would use the internal name of the field you want to update.
    {
        "formValues":[
    	{
    	    "FieldName": "ArchiveDate",
    	    "FieldValue": "@{formatDateTime(body('Archive_Date'),'MM/dd/yyyy')}"
    	},
    	{
    	    "FieldName": "Days",
    	    "FieldValue": "@{outputs('Compose_Days_to_Complete')}"
    	}
        ]
    }
     
  • Suggested answer
    FLMike Profile Picture
    FLMike 29,366 on at
    Updating a sharepoint List Item
    Hi,

    yes you must fill in the required fields, that being said, DisplayName is simply an attribute of a Person/Group Item, and should not be set directly as its not a separate thing
     
    Can you put a circle around the field giving you the error.
     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard

Featured topics

Restore a deleted flow