cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ambro00
Level: Powered On

Lookup field usage

I have a question related to lookup data type.
I have 2 tables: employees and insurance. They are linked with through a relationship created in the insurance table. So in the insurance table we have a field called employees which is a lookup data type. I created an app which manages the employees table and I would like to display a page of insurances related to the employee record chosen in the employees pages. I thought I could do it using he lookup field, but I can't.

Everytime I try to use the lookup field I receive the error message like: property expect text value, but this rule produces incompatible record value

how can I do it?

2 REPLIES 2
Community Support Team
Community Support Team

Re: Lookup field usage

Hi @Ambro00,

 

Thanks for posting.

Could you please share more details about the data source?

 

If the data source here are SharePoint list or Common Data Service, then the Lookup field is considered as record.

To work with this field, we should switch the field as:

LookupFieldName.Value

Or

LookupFieldName.ID

For example, in your scenario, assuming the data source is SharePoint list,

after user selection from the Employee gallery, and you would have the insurance filtered by the Employee selected, then the formula under the items property of insurance gallery should be:

Filter(Insurance, Employees.ID=Gallery1.Selected.ID)

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ambro00
Level: Powered On

Re: Lookup field usage

Hi. here is the insurance table export template: PRIMARYID DECORRENZA SCADENZA POLICY_ID PLAN_CAPITALE RECORDID CREATEDBYUSER CREATEDONDATETIME LASTMODIFIEDBYUSER LASTMODIFIEDDATETIME EMPLOYEES_PRIMARYID (this is the filed created automatically from the relationship with the Employees table.) If you access insurance table through powerapps webtool, the name of this field is Employees (and not EMPLOYEES_PRIMARYID) I tried your suggestion, but they didn't work. it seems that employees.id (or Employees.primaryid) can't be checked against the Gallery1.Selected.ID. Thanks