cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HansHeintz
Post Patron
Post Patron

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
v-yuxima-msft
Community Support
Community Support

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

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,447)