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
Resident Rockstar
Resident Rockstar

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,832)