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

Returned value from patch is empty

Hi everyone,

I need to utilize the ID of a newly created record immediately after patching. I manage to write it in a text box, but when I try to add it in a mail immediatly after the patch, the value is empty.

The process is as follows:

- User fills in input and presses OK when finished
- The button "OK" patches to a SQL server and saves information from patch in a collection.
- Ideally, the press on OK also triggers a mail that sends a link that includes the ID to another user.

However, the values in the mail are empty - it seems like powerapps is too slow saving the information in the collection, so that the reference returns an empty value from the collection (I have checked the flow sending the email and the input is empty). I have tested to simply write the results from the collection in a textbox in my app and the values are shown here after patching - hence, I do not think my code is the problem.

Any idea/workaround to how I can manage to add this information to the mail immediatly after patching?

1 REPLY 1
Dual Super User II
Dual Super User II

Hi @tfarsund 

 

Assuming you are setting the response in a variable

 

example:

 

Set(varResult, Patch ...) ; sendemail

 

in send email you can use the variable and it should work

 

another option would be to trigger a timer after patch and then on timer complete you can send the email (timer will act like a delay)

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (74,666)