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

Converting Form record (Product of sharepoint lookup) to text value

Hey everyone,

 

I am trying to create auto generated emails from assigned employees in a sharepoint list. The way these employees get assigned is via a dropdown menu (lookup) from a sharepoint list.

 

When I go to copy the value via a lookup, set, updatecontext etc, I get an error because the data type is a record and it expects a text. If I do the same thing with a non-lookup value from the same sharepoint list, the datacard value easily populates the textbox I have created with no errors.

 

What should I do to make this work?

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @AlexMcomm ,

Do you want to get email from employee field?

Could you tell me data type of employee field?

1)If it is a person field, you could use this get email:

First(listname.employee).Email   or  LookUp(listname,....,employee).Email

2)If it is a lookup field, could you tell me the structure of its related list and the related field's data type?

If employee field's related field is Email and it is text type, you could use this get email:

First(listname.employee).Value   or  LookUp(listname,....,employee).Value

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
EricLott
Super User
Super User

To convert a record to text, you may need to use something like this:

 

YourRecord.Value

 

or

 

First(YourRecord).Value

 

 See the docs here:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/data-types

RecordA record of data values. This compound data type contains instances of other data types that are listed in this topic. More information: Working with tables.{ Company: "Northwind Traders",
Staff: 35,
NonProfit: false }
Record referenceA reference to a record in an entity. Such references are often used with polymorphic lookups. More information: Working with references.First(Accounts).Owner

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

v-yutliu-msft
Community Support
Community Support

Hi @AlexMcomm ,

Do you want to get email from employee field?

Could you tell me data type of employee field?

1)If it is a person field, you could use this get email:

First(listname.employee).Email   or  LookUp(listname,....,employee).Email

2)If it is a lookup field, could you tell me the structure of its related list and the related field's data type?

If employee field's related field is Email and it is text type, you could use this get email:

First(listname.employee).Value   or  LookUp(listname,....,employee).Value

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

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

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 (48,140)