cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimboSey
Helper IV
Helper IV

PowerApp button to trigger flow

Hi,

 

I have an App which users submit workitem requests, using a SharePoint list to collect the data. In my SharePoint list I have a choice column for 'Status', there are just two choices either Submitted or Draft.

 

Id like to create a Flow, that when button is pressed will look at the 'Status' column, and delete any items marked 'Draft' that have been created (I will use the Created date) more than for example 30 days ago.

 

So when I press the button, any draft items older than 30 days will be deleted.

 

Thanks

2 REPLIES 2
Akash17
Responsive Resident
Responsive Resident

Hi @JimboSey 

PowerApps  will be trigger

then Get Item action 

In get item you can write filter quarry like Status=Draft and Created date is greater than 30

then use delete item and provide above id from dynamic content

v-qiaqi-msft
Community Support
Community Support

Hi @JimboSey,

Do you want to delete all the draft status items that created more than 30 days?

 

Here is a flow for your reference:

vqiaqimsft_0-1659599646970.png

 

formatDateTime(item()['CreatedDate'],'yyyy-MM-dd')
addDays(utcNow(),-30,'yyyy-MM-dd')

 

Note that you should select StatusValue from the Dynamic content, and select ID from the Get items tab in the Dynamic content as well.

 

In addition, since you trigger the flow from Power Apps, you should set the OnSelect property of a button as below:

YourFlowName.Run()

vqiaqimsft_1-1659599968768.png

Best Regards,
Qi

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,109)