cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
martinav
Community Champion
Community Champion

Sequential setting of context variables, and Run command issue *URGENT*

I am setting a few variables before running a flow.  It seems like the formula chaining is NOT waiting for a result before moving on to the next instruction in the chain.  My variables MUST be complete before executing the run command, or data is in error.  How do you ensure variables are completely setup before running the flow?  I do NOT want to use a timer, because you have to buffer in so much time to ensure worst case is covered.  That causes unnecessary delays in the application.  I would think there is a way to chain commands that would be purely in series.  Possible?

 

OnSelect action:

UpdateContext({Var1:Value1}); UpdateContext({Var2:2*Value1}); UpdateContext({First(Lookup(Source,Name=Var1 AND Place=Var2,Filename))}; Flow.Run(Filename)

The above is completely hypothetical, but is a simple example.  It seems that the Lookup is not completed when the Run command is attempted.  What often happens is that on first select, the Run command will error.  If I pick a second time, the Run succeeds.  Thus, it appears the above statement is not purely sequential.  It does not wait for the previous action to complete before moving on.  How do I ensure this?  It is an absolute must for my app to be effective.  

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Yes, you are right.  That was a hypothetical with what I was doing with much simpler statements.  I ended up finding that I had a CONCURRENT() that had two context variables that had relation.  That caused a problem with order.  Issue is resolved.

 

Thanks for the reply.

View solution in original post

2 REPLIES 2
v-micsh-msft
Community Support
Community Support

Hi @martinav,

 

I think there is a little problem for the updatecontext() used in your formula:

UpdateContext({First(Lookup(Source,Name=Var1 AND Place=Var2,Filename))}

which should be changed to:

UpdateContext({FileName1: Lookup(Source,Name=Var1 AND Place=Var2,Filename)})

After that, use the FileName1 as the parameter in the Flow.Run().

Let me know if that works.

 

Regards,

Michael

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

Yes, you are right.  That was a hypothetical with what I was doing with much simpler statements.  I ended up finding that I had a CONCURRENT() that had two context variables that had relation.  That caused a problem with order.  Issue is resolved.

 

Thanks for the reply.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,690)