web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Check if flow ran succ...
Power Apps
Unanswered

Check if flow ran successfully

(0) ShareShare
ReportReport
Posted on by 820

Hi

I have a flow in my powerapp that runs at the very end of the patch statement while grabing last patched items ID and then flow is putting the files in a sharepoint list and associates it with that item ID. How do i check id the flow ran successfully and notify user on screen?

Here is my code:

ForAll(FileAttachments.Attachments,
SaveAttachments.Run(recID,
{
file: {
contentBytes:Value,
name: Name
}
}

)
);

Categories:
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @jja ,

     

    You could try:

     

    ForAll(
     FileAttachments.Attachments,
     SaveAttachments.Run(recID,{file: {contentBytes:Value,name: Name}});
     Notify("File "& Name &" has been uploaded")
    );

     

     

    Best Regards,

    Bof

     

  • julijazas Profile Picture
    820 on at

    @v-bofeng-msft 

    My expectation is to nofity either it is success then notificiation type success or Error then notification type Error something like i usualy do while patching data.

    i

  • Fardy_MADI_2 Profile Picture
    334 Super User 2024 Season 1 on at

    Hi @jja,

     

    At the end of your flow you can put a respond to power Apps.

     

    Mio3K.png

    Then in Power Apps you can use this formula :

    If(
     Flow.Run(Input1, Input2).success = "True",
     Notify("Data submitted succesfully",NotificationType.Success,2000),
     Notify("Error occurred, please contact your administrator",NotificationType.Error,5000)
    )

     

    Hope this will help you 🙂

  • julijazas Profile Picture
    820 on at

    @Fardy1 

    I have error on the flow itself if i try your suggested approach. What do i do wrong?

     

    jja_0-1689596631446.png

     

  • JasonZF Profile Picture
    572 on at

    On the response action that returns "false," you need to configure the run after so it only runs when the previous action fails. Edit the flow, then click the three dots on that action. There should be an item called "configure run after."

  • julijazas Profile Picture
    820 on at

    @JasonWS 

    do i need to remove flow connector and readd it into powerapps to be able to execute this?

    Flow.Run(Input1, Input2).success = "True",
  • julijazas Profile Picture
    820 on at

    @JasonWS @Fardy1 @v-bofeng-msft 

    do i need to write If statement already after the flow was executed? for me it seems if i write if statement it again tried to execute flow where i need to check only the result of flow. and i also can't pass input2 to if statement where input 2 is 

    {file: {contentBytes:Value,name: Name}}
  • JasonZF Profile Picture
    572 on at

    Even if it's inside an If() statement, it still runs the flow. Running the flow and checking its result is done in the same step. I would try something like this. This collects the filename and the flow's result into a two-column collection. Run this on an item that has more than one attachment, and then view the collection in the editor, and see if it shows correctly. If all works well, then you can display this collection in a small gallery or data table after the submission to show the user all of the files that were successfully (or unsuccessfully) saved/uploaded. I may have the indenting wrong, as I composed this in Notepad++

     

     

    Clear(colSaveResults);
    ForAll(
    	FileAttachments.Attachments,
    	Collect(
    		colSaveResults,
    		{
    			File: Name
    			Result: SaveAttachments.Run(recID,
    				{
    					file: {
    						contentBytes:Value,
    						name: Name
    					}
    				}
    			).success
    		}
    )
    )

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 383 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard