cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
VinL
Level: Powered On

Different between && Concurrent ;

I am making a sceen that contains two forms and when submit, two tables in onedrive excel are modified

What are the different between:
1. Onselect: Submitform(Form1); Submitform(Form2)

2. Onselect: Submitform(Form1) && Submitform(Form2)

3. Onselect: Concurrent(Submitform(Form1), Submitform(Form2))

are all 3 bascially doing the same thing?
1 ACCEPTED SOLUTION

Accepted Solutions
FernandoTC
Level: Powered On

Re: Different between && Concurrent ;

Hi @VinL 

 

The main and most relevant differences are the following:

 

  • If you separate two or more Statements with ; the code will run those expressions sequentially one after each other. In your case, it will submit Form1, then Submit Form2.
  • If you use the Concurrent() function instead, the code will evaluate and perform the actions all at the same time. It will Submit Form 1 and Form 2 at the same time. In most cases it will increase your code speed since your waiting time now equals the time spent by the most time-requesting statement among all Concurrent() arguments and not the sum of every single one (Which is what happens with ; separator).

    Also, even if Concurrent() is quite useful, you have to be careful as you cannot use it in cases where you are trying to write in the same data source several times, as you cannot access the action simultaneously.

  • The last one && equals an And() operator, which is not valid for concatenate statements. However, it works when submitting Forms. Avoid using it as it won't work in most of the cases and go for the other 2 options.

In the case you exposed, I'll definitely go for the Concurrent() one as it will submit the two forms as the same time.

 

Hope this clarifies your doubts

View solution in original post

1 REPLY 1
FernandoTC
Level: Powered On

Re: Different between && Concurrent ;

Hi @VinL 

 

The main and most relevant differences are the following:

 

  • If you separate two or more Statements with ; the code will run those expressions sequentially one after each other. In your case, it will submit Form1, then Submit Form2.
  • If you use the Concurrent() function instead, the code will evaluate and perform the actions all at the same time. It will Submit Form 1 and Form 2 at the same time. In most cases it will increase your code speed since your waiting time now equals the time spent by the most time-requesting statement among all Concurrent() arguments and not the sum of every single one (Which is what happens with ; separator).

    Also, even if Concurrent() is quite useful, you have to be careful as you cannot use it in cases where you are trying to write in the same data source several times, as you cannot access the action simultaneously.

  • The last one && equals an And() operator, which is not valid for concatenate statements. However, it works when submitting Forms. Avoid using it as it won't work in most of the cases and go for the other 2 options.

In the case you exposed, I'll definitely go for the Concurrent() one as it will submit the two forms as the same time.

 

Hope this clarifies your doubts

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,463)