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
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
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
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?
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)
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