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

Combine Functions

Hi, 

 

I have two buttons that both triggers some functions on select:

 

- Function one:  SubmitForm(Form2)&&Refresh('Timeføring historikk')&&ResetForm(Form2)

 

- Function two: (ClearCollect(Samling;(AddColumns(GroupBy(AddColumns(Filter('Timeføring historikk';Navn=navnTilBruker);"Prosjektvalg";Prosjekt.Value);"Prosjektvalg";"ValgtProsjekt");"SumAvTimer";Sum(ValgtProsjekt;Antalltimer)))))

 

Everything works as it should when I first select the first button, then the second. The problem occurs when I want to trigger both functions by only pushing on button. I tried to add the second function to the first one by adding "&&" like I did with the first function, but with no success. I guess it has to do with the SP collection that both functions refers to. But as long as the firs function runs first, the list should be updated before the second function takes that list as input for creating a new collection.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Community Champion
Community Champion

@dahlgebra 

I believe you have the wrong syntax for a line-break.  The double semi-colon ;; is a line-break.  You should use it instead of &&.

SubmitForm(Form2);; 
Refresh('Timeføring historikk');;
ResetForm(Form2);;
ClearCollect(Samling;(AddColumns(GroupBy(AddColumns(Filter('Timeføring historikk';Navn=navnTilBruker);"Prosjektvalg";Prosjekt.Value);"Prosjektvalg";"ValgtProsjekt");"SumAvTimer";Sum(ValgtProsjekt;Antalltimer))));;

 

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

2 REPLIES 2
mdevaney
Community Champion
Community Champion

@dahlgebra 

I believe you have the wrong syntax for a line-break.  The double semi-colon ;; is a line-break.  You should use it instead of &&.

SubmitForm(Form2);; 
Refresh('Timeføring historikk');;
ResetForm(Form2);;
ClearCollect(Samling;(AddColumns(GroupBy(AddColumns(Filter('Timeføring historikk';Navn=navnTilBruker);"Prosjektvalg";Prosjekt.Value);"Prosjektvalg";"ValgtProsjekt");"SumAvTimer";Sum(ValgtProsjekt;Antalltimer))));;

 

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

Drrickryp
Super User
Super User

Hi @dahlgebra 

I think it would work if your replaced the && with ;; 

Then the functions should work sequentially.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,720)