cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Validating Lookup Field for User?

I noticed that when using these fields, you are able to submit anything in the field. Is there a way to ensure that the person submitting the field is submitting a valid user in a Lookup (User) field?

 

Also, another issue I noticed. After submitting a form and storing the last submitted into a variable, using another form to display what was submitted by setting the 'Item' property to the variable for the last submitted record, when the display form is rendered, the Lookup (User) fields are blank (even with valid users).

 

Thank you!

8 REPLIES 8
Highlighted
Super User
Super User

Re: Validating Lookup Field for User?

@mseto 
Could you please share a screenshot of your app?

Other questions:

How are you ensuring only valid users can be selected?

Are you using and Edit Form or are you patching the data?

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Helper I
Helper I

Re: Validating Lookup Field for User?

I am asking how to validate the user lookup fields upon submitting the form. I attached a screen snippet on what the form looks like after an item has been submitted. Notice the three Lookup (User) fields are blank. I submitted the form with valid users in those fields too.

Highlighted
Super User
Super User

Re: Validating Lookup Field for User?

@mseto 
Can you please show what the form looks like before it is submitted?

Highlighted
Helper I
Helper I

Re: Validating Lookup Field for User?

I cannot as it will violate some internal company policies. I explained it was my lookup user fields having issues. It's just a form to create a new item within an entity. Just some text fields and three user lookup fields (as I mentioned.)

Highlighted
Super User
Super User

Re: Validating Lookup Field for User?

@mseto 
What control type are you using for User: Text-field, Combobox, Dropdown?  Please provide any code used in the Items and Update properties.

Highlighted
Helper I
Helper I

Re: Validating Lookup Field for User?

It's an Edit form connected to a data source. You select the fields for the form and it adds them. It's a data card. If you're a super user, you should know that if you add a lookup field to an entity, it adds it as a drop down. You can't control the type of field it uses when adding the lookup field to the entity. Are you doing this for more posts or something? If so, save us the time please.

Highlighted
Super User
Super User

Re: Validating Lookup Field for User?

@mseto 

No, I'm doing this because I actually wanted to help you.  I've worked on too many posts where the original poster does not accurately describe their form, especially when it comes to Comboboxes vs. Dropdowns.  This information impacts my ability to diagnose your problem and solve it.

 

So please, be kind to the people who are trying to help you solve your issues.  I don't get paid to do this. I do it because I love PowerApps and want to help people solve their problems.  You might not understand why we are asking certain questions but that's no reason to be rude.  To be clear, making posts does not give Super User status.  You must get enough posts 'Accepted As Solution' to earn it.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

 

Highlighted
Helper I
Helper I

Re: Validating Lookup Field for User?

Ok. I have come across people (such as on stackoverflow) who just randomly post things to keep the threads going long so they can rank up. I would hope that you know that when I created the entity, I added the field with a 'Data type' of 'Lookup' and 'Related entity' of 'User'. It does not give any options for the field type, and I don't think it should. A field to choose a person should be a drop down, not a textbox or listbox. That being said, my edit form has three of those, and when someone clicks the submit button, it does a 'SubmitForm(FormName)' and then 'Set(LastSubmittedRecord, FormName.LastSubmit)' and then when someone clicks a button that yes, they want to see the submitted data, it brings a display form into the view (from being hidden) which has an item property of 'LastSubmittedRecord'. That is where I am noticing the empty fields. 

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,092)