cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Stuart3
Regular Visitor

Approving a Flow and then removing a name from a List

Hi,

 

I have been working on this 'simple' task for a few days and I'm finally asking for some help.

 

I'm looking to have a form sent to a colleague for approval then having the data submitter having their name removed from a list once approved.

 

I was using this link for rough guidance but I cant get the name to be removed from the list after approval.

 

Solved: Re: Remove row/record from sharepoint list - Power Platform Community (microsoft.com)

 

My test List for removal is called 'TBD Follow Up2':

 

IDData Provider Name

1

Stuart
2Jane

 

Strangely on the form I have named the Data Provider column "Stuart" please ignore this. I just want to get a trial up and running.

 

Basically once Jane's submission  has been approved she can be deleted from the List.

 

However my flow fails:

 

1.PNG2.PNG3.PNG4.PNGHelp.PNG

 

Any help would be great.

 

Thanks.

9 REPLIES 9
annajhaveri
Super User
Super User

@Stuart3  what is the data type of Data Provider column in your SharePoint list, is it single line of text, if yes then you can directly apply query in Get Items using Filter query e.g. ColumnName eq 'value', so that you will not need filter array action. The error that you are facing is in Set Variable action, what expression are you using in the value parameter of Set Variable action, can you please provide the expression?

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Stuart3
Regular Visitor

Hi, 

 

Thanks for your reply.

 

Yes it is a single line of text.

 

the expression I set is : 

item('Apply_to_each')?['Data Provider Name']
 
Thanks,
S

@Stuart3 okay to avoid an extra step you can directly use filter query in Get Items instead of using Filter Array, you could do that.

 

The expression seems to have typo in item, it should be items('Apply_to_each')?['Data Provider Name']

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Stuart3
Regular Visitor

Hi,

 

In my example what should the filter query look like?

 

I basically want to remove the name from the approved form from the Sharepoint list. The form column is called "Stuart" and the corresponding List column is "Data Provider".

 

Thanks

 

S

 

@Stuart3  in order to use filter query, first you need to get internal name of column "Data Provider" in list, so go to your SharePoint List settings, you will see the Data Provider column there, click on that column. Now look at URL in the browser, you will see ?Field=, whatever name is where after ?Field= take that column name. E.g. if url is http://test.sharepoint.com/sites/test/_layouts/15/FldEditEx.aspx?List=%7BA4E78CC7-F74F-4733-832A-099... then here FirstName is my column internal name.

 

Now take the internal name e.g. FirstName, provide filter query as FirstName eq '<here select value from dynamic content of idtodelete>'

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Stuart3
Regular Visitor

Hi,

 

OK. I have corrected the typo.

 

Found the field name and set the filter.

 

What am I missing from the following?

 

Capture.PNG

 

Thanks

S

@Stuart3  you need to provide the Id in Delete Item action, from Get Items dynamic content, use below expression to get the Id value

first(body('Get_items')?['value'])?['ID']
Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Stuart3
Regular Visitor

Hi,

 

I've simplified my flow to get it running.

 

As there will only ever be one provider request and one approval I presume For Each loop is not needed.

 

I've put into your Suggestion below (highlighted) but it just deletes the first ID from each List. What I need is when variable "Stuart" from the Form submission equals "DataProvider" to be deleted only. i.e. Jane is accepted and then she's removed from the list.

 

Does this make sense?

 

Capture.PNG

 

Thanks

 

S

 

@Stuart3  okay in that case your Get Items filter does not seem to work, can you please expand the get item action in your flow and provide the screenshot of it, so that i can see the Filter Query 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,261)