cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sharuk
Helper V
Helper V

Getting the output of previous formula

Hi, is it possible to get the values of formula and set it to another variable.

 

i'm using the following formula in gallery items

Sort(Filter(CompanyData,Company.Value = Drp_Company.Selected.Value && Region = Drp_Region.Selected.Result && CEO = Drp_CEO.Selected.Result),Title)

now i want get the output to set to another variable something like 

Set(vOutput, output(previous line formula))

i think, we can set it like by Set(vOutput,Sort(Filter(CompanyData,Company.Value = Drp_Company.Selected.Value && Region = Drp_Region.Selected.Result && CEO = Drp_CEO.Selected.Result),Title))

but is there a way something like
Sort(Filter(CompanyData,Company.Value = Drp_Company.Selected.Value && Region = Drp_Region.Selected.Result && CEO = Drp_CEO.Selected.Result),Title);
Set(vOutput, output(previous line formula))

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @Sharuk 

No, there's no formulaic 'keyword' to retrieve the output of the previous line in a formula.

I'm curious as to why you want to do this? What's the use case scenario?

As you say, this is the closest method to achieve what you want.

 

Set(vOutput,
Sort(Filter(CompanyData,Company.Value = Drp_Company.Selected.Value && Region = Drp_Region.Selected.Result && CEO = Drp_CEO.Selected.Result),Title))


It might also be worth noting that when you set the items property of a gallery control, you can access the items in the gallery using the BrowseGallery1.AllItems syntax. Depending on what you want to accomplish, this might provide an alternative to using a variable.

View solution in original post

1 REPLY 1
timl
Super User
Super User

Hi @Sharuk 

No, there's no formulaic 'keyword' to retrieve the output of the previous line in a formula.

I'm curious as to why you want to do this? What's the use case scenario?

As you say, this is the closest method to achieve what you want.

 

Set(vOutput,
Sort(Filter(CompanyData,Company.Value = Drp_Company.Selected.Value && Region = Drp_Region.Selected.Result && CEO = Drp_CEO.Selected.Result),Title))


It might also be worth noting that when you set the items property of a gallery control, you can access the items in the gallery using the BrowseGallery1.AllItems syntax. Depending on what you want to accomplish, this might provide an alternative to using a variable.

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 (5,058)