cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Return a single text value from a collection

I think I'm at the point where I've been staring at this for too long, and I'm missing something simple.

 

I have a collection that gathers an employee's record based on their unique ID. I'm trying to reach into that collection and return their Job Title as a variable to make certain functions only visible for those that need them. When I'm using a button with:

 

 

Set(Occupation, UserList.Job_Title);

 

 

I get an error everywhere the variable Occupation is used saying "Invalid argument type".  In the variables section, it says "Contribute types: Table" on the button.

 

In the App.Onstart, I'm using:

 

 

 

Set(Occupation, "Operator");

 

 

 

to designate everyone with the lowest privileges until their unique ID is put in. In the variables section, it says "Contribute types: Text".

 

So, I know I'm trying to compare a table to a text item. How do it return the text value from a specific column (Job_Title) in the collection (UserList) and assign it to my variable (Occupation)?

 

Any help is greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Re: Return a single text value from a collection

Hi @Rob_LVT ,

From the description, you have one record in this collection and you want one field from this record. Try this

Set(
   vOccupation,
   First(UserList).Job_Title
)

 

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

2 REPLIES 2
Super User III
Super User III

Re: Return a single text value from a collection

Hi @Rob_LVT ,

From the description, you have one record in this collection and you want one field from this record. Try this

Set(
   vOccupation,
   First(UserList).Job_Title
)

 

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

Highlighted
Frequent Visitor

Re: Return a single text value from a collection

@WarrenBelz ,

 

That was what I was looking for! Thank you!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,060)