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

Search for a column in a collection using a variable lable from a data record in a gallery

Hello community,

Today I have a really crazy question and I have no idea whether it is even possible.

 

I have a collection with the column names "Col1", "Col2", "Col3" and "Col4".
Now I have a gallery. The gallery is filled via a SharePoint list and in this SharePoint list there is the column name for each data record. So "Col2" could be in one data set, "Col4" in another, and "Col1" in a third data set.

 

I now display this data field from SharePoint in the gallery and now I had this crazy idea:

does it work that I flexibly fetch the value for the column name from the gallery, then a function is provided, e.g. remembers "Col2", then goes into the collection, and shows me the value from "Col2" from the collection in the gallery record?

 

Can you even understand what I mean here, because unfortunately English is not my mother tongue and I work with the Google translator here.

 

Best regards

RoScha

1 ACCEPTED SOLUTION

Accepted Solutions

@RoScha ,

Just a Switch() statement with whatever you are doing

Switch(
   YourVariable,
   "Column1",
   Column1,
   "Column2",
   Column2
   . . . . 
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @RoScha ,

You cannot dynamically refer to control or field names in Power Apps - is this what you mean?

You could "hard code" it.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

RoScha
Helper V
Helper V

@WarrenBelz 

It's a shame ... but what should such a "hard code" look like in my example?

@RoScha ,

Just a Switch() statement with whatever you are doing

Switch(
   YourVariable,
   "Column1",
   Column1,
   "Column2",
   Column2
   . . . . 
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

WarrenBelz
Super User
Super User

Hi @RoScha ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

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.

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