cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HansHeintz
Level 8

Dropdown on id related field picks default value when record value is empty

I have a table Animals with field Breed.

Breed is an integer slave id field to master Breeds table.

I use a dropdown to make users choose a breed. (ras=dutch for breed)

Items

'[dbo].[ras]'

Default 
LookUp('[dbo].[ras]';ras_id=Parent.Default;naam) //get breed name for existing breed in table

 

I am not into adding records to this database from the powerapps yet but if I edit a record with no breed selected this happens:

A breed is chosen for me. It might be the first from the table or it might be the last one I used on another record.

 

Q1 How can be:

I inspect the value of the field in the database (parent.default) in a record with no value for breed

Since it is an integer ID field the value will probably be 0

A label with this value will not show anything. Even if I format "#.00"

A label with Empty(parent.default) will say true

A label with parent.default = 0 will say false

A label with parent.default+1 will say 1

A label with abs(parent.default) < 0.000/*..as many zero's as you like..*/0000001 will say true

 

Q2 What is the best way to solve the unwanted selection of the dropdown.

In the propriety software that uses the sql database I now added a breed called "-" and have this be the default. Is that really the best I can do?

2 REPLIES 2
Community Support Team
Community Support Team

Re: Dropdown on id related field picks default value when record value is empty

Hi @HansHeintz 

 

Could you please share more details of your data source?

What data source is it?

What is the column type?

Could you please share the stucture of your data source?

Could you please share more details of your controls in your App and more details of their formula expreesion?

 

Best Regards.

Yumia

HansHeintz
Level 8

Re: Dropdown on id related field picks default value when record value is empty

I fail to see the congruence between my message and your reply. Is it automated?

I explicitly mentioned the column type as being an integer id field.

I asked what is the best way to deal with using a dropdown on a relation slave field when the original record has no value for that field yet c.q. the value is 0. I did not ask what is wrong with my code.

I am sorry but I see a lot of "message management" here in stead of real replies.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,462)