Skip to main content

Notifications

Power Automate - General Discussion
Answered

help needed! Condition to replace people column with blank not working

(0) ShareShare
ReportReport
Posted on by 117

Hi all, been going on for many hours for what seems really simple, but i cannot get it to work the way i wanted

 

Heres my flow for context:

1. when an item is created or modified (projectlist)

2. get items (tasklist) with filter query ProjectID (in tasklist) eq ID (in projectlist)

3. Initialize variable named 'varProjectLead2' / string / empty field in value

4. apply to each with condition

4a. condition is when project lead 2 is equal to null 

4b. if yes, apply varProjectLead2 into Project Lead 2 field to make it blank

4c. if no, then apply Updated Project Lead 2 name

 

so that all my testing, it didnt recognise that ProjectLead2 field is empty. im stuck!!

i want the flow to make projectlead2 in tasklist as blank when i remove projectlead2 in projectlist

 

appreciate any help! thank you

 

AndyYWS_0-1692098290378.pngAndyYWS_1-1692098320934.pngAndyYWS_2-1692098365701.png

 

  • AndyYWS Profile Picture
    AndyYWS 117 on at
    Re: help needed! Condition to replace people column with blank not working

    Hi @ManishSolanki , strangely i tried your input again and now its working!

     

    i dont know why its working after i have failed for so many times, but thank you again

  • ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    Re: help needed! Condition to replace people column with blank not working

    Hi @AndyYWS 

     

    Pls check the URI, it should start with "_api". Also check if you are the part of Site owners group in SP site.

     

    If it helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • AndyYWS Profile Picture
    AndyYWS 117 on at
    Re: help needed! Condition to replace people column with blank not working

    Hi @ManishSolanki ,

     

    after the post, i found out that i cannot use update to clear the field, and also tested on the send HTTP, but i get an error on 401 unauthorized access.

     

    I dont know if it is part of the security from my company or what causes it, do you have an idea?

  • Verified answer
    ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    Re: help needed! Condition to replace people column with blank not working

    Hi @AndyYWS 

     

    You could not clear the value of user or person field using 'Update item' action but it is possible using "Send an http request to SharePoint" action. You may add this extra action to clear the user or person field as per your need.

     

    Here is an example:

    I have taken "Job" as a custom list with 'Owner' as the user or person field (single user field)

    ManishSolanki_0-1692106389838.png

    Input Parameters values:

    Site Address: <<SharePoint site URL>>

    Method: POST

    Uri: _api/lists/getbytitle('<list name>')/items(@{outputs('Update_item')?['body/ID']})

    Headers

    {
    "Accept": "application/json;odata=verbose",
    "Content-Type": "application/json;odata=verbose",
    "X-HTTP-Method": "MERGE",
    "IF-MATCH": "*"
    }

     Body:

    {
    "__metadata": {
    "type": "SP.Data.JobListItem"
    },
    "OwnerId" : -1
    }

    If list name contains white or blank space in between name, then pls replace white space with '_x0020_'. For instance, if list name is 'Job List' then metadata type should be used as'SP.Data.Job_x0020_ListListItem'  in the body of the http request.

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,434

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,722

Leaderboard