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

Run() Flow does not pick up edited form field from Powerapps

Hello,

here is a simplified description of my problem:

 

  • I ask the user for a comment (field in form vie Form.edit)
  • User clicks a 'send' button. OnSelect properties:
    • Patch to write the comment back into the source file (SharePoint list) 

 

Patch(AP_Data,GalleryAP.Selected,{Comment:Comment_Field.Text});​

 

  • run a flow to send out an email, that includes the previously updated comment field:

 

email.Run(...,...,...,If(IsBlank(GalleryAP.Selected.Comment),"n.a.",GalleryAP.Selected.Comment),...,);​

 

I'm thinking that the patch function is not quick enough to save the content in time for the Run()-function to pick it up, as I most often get an "n.a" returned. It works sometimes, but that is of course not good enough.

 

BTW, when i remove the if(isblank(), I get the following error, which i believe is returned when a blank field is passed through Run(): 

 

Email.Run failed: The method 'Run' has an invalid value parameter 'Sendanemail(V2)_Body_15'

 

 

Has anyone experienced this issue before. Can anyone think of a solid workaround for this issue?

 

Thanks,

Tobias 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@Krau5i 

Have you tried using REFRESH before calling your Flow?

 

Patch(AP_Data,GalleryAP.Selected,{Comment:Comment_Field.Text});​
Refresh(AP_Data);
email.Run(...,...,...,If(IsBlank(GalleryAP.Selected.Comment),"n.a.",GalleryAP.Selected.Comment),...,);​

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

4 REPLIES 4
Super User III
Super User III

@Krau5i 

Have you tried using REFRESH before calling your Flow?

 

Patch(AP_Data,GalleryAP.Selected,{Comment:Comment_Field.Text});​
Refresh(AP_Data);
email.Run(...,...,...,If(IsBlank(GalleryAP.Selected.Comment),"n.a.",GalleryAP.Selected.Comment),...,);​

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Community Support
Community Support

Hi @Krau5i ,

I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the "Send" button to following:

Set(   // Save the Patch result into a variable
    SubmittedRecord, 
    Patch(AP_Data, GalleryAP.Selected, {Comment:Comment_Field.Text})
);
// Reference the Comment field value from above variable
email.Run(...,...,..., If(IsBlank(SubmittedRecord.Comment), "n.a.", GalleryAP.Selected.Comment),...,);​

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I tried your solution as well but could not get it to work in my example. However, problem is solved with Refresh().

 

Thanks!

@Krau5i 

Happy to see you issue is now fixed!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,679)