cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rob_LVT
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
WarrenBelz
Super User III
Super User III

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
WarrenBelz
Super User III
Super User III

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

@WarrenBelz ,

 

That was what I was looking for! Thank you!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,143)