cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resident Rockstar
Resident Rockstar

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
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
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.

Top Solution Authors
Top Kudoed Authors
Users online (107,748)