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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (15,970)