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

Drop down box question

Hi,

I have 2 different tables:

1.     Sites

         SiteID

         SiteName

2.     Jobs

         JobID

         SiteID

         JobNo

         Job description

 

I created a browse screen to show quick view for open jobs - I need to display SIteName and Job no.

Template shows already SiteID and Job no, but I need Site Name so everyone can understand where to go.

Now, I tried to add a dropdown box to pull information from Sites table, looks ok but there is a problem; always shows first value on Sites table.

Sites and Jobs are stored in SQL Office 365 server, as you can see there is a SiteID lookup field on jobs list, but still I can't make it work - must be I am doing something wrong.

Any ideeas about this?

Thanks,

Lucian

1 ACCEPTED SOLUTION

Accepted Solutions
LucianB
Level: Powered On

Re: Drop down box question

Hi hpkeong,

Your ideea works just fine, thank you very much.

However, as I said yesterday it's loading very slow, but at least does the job.

 

Thanks again for your help,  I will accept your answer as a solution and I will move on with another issue :)!

View solution in original post

10 REPLIES 10
hpkeong
Level 10

Re: Drop down box question

Hi

 

 

You can use Distinct for Dropdown and then use LookUp to pull information for corresponding SiteName, and

Patch or Browse, as you wish.

(I stopped my car at the road site when I saw your message and I wish my road-side CLUES, works for you again!. TQ)

 

e.g. for reference.

LookUp(TableSite, SiteID in Dropdown1.Selected.Result).SiteName

...please modify as of your needs...

 

Screenshot (92).png

 

 

Hope it helps.

hpkeong
LucianB
Level: Powered On

Re: Drop down box question

Hi hpkeong,

Thanks for your answer. Using Lookup is a solution, but not the best one. I think you agree with me this solution is really too slow.

I taught there's a way to do this more efficient, like Access does, for example.

If there's no other way, I will use Lookup.

 

hpkeong
Level 10

Re: Drop down box question

Hi

 

I am not really sure what is your approach in your apps, though looks pretty simple.

I am just quoting example of using LookUp.

You may use Filter or any other methods, so that the related SiteName is display next to SiteID whenever it is chosen, say in your Gallery, automatically.

(I am just quoting way outside the box).

 

Have a nice day.

hpkeong
LucianB
Level: Powered On

Re: Drop down box question

Hi,

Yes, it is a simple solution, but coming after long years working in access, this approach looks not familiar to me.

Anyway, it is a solution and thank you very much for it!

hpkeong
Level 10

Re: Drop down box question

Hi

 

You are most welcome.

Different environment has different approaches, and it is just a matter of adaptation.

 

Thanks, too.

hpkeong
LucianB
Level: Powered On

Re: Drop down box question

Hi guys,

Solution proposed by hpkeong is not working for me.

Probably i didn't make my self clear enough, I really think must be a very easy solution, as this is very common thing.

Let me explain again:

I have 2 tables:

Sites: SiteID; SiteName, Sitedetails

Jobs: JobID, SiteID, JobNo, JobDetails

 

I need in browse screen to display few information, like that:

 

SiteName; JobNo; JobDetails.

 

At this moment I can display:

SiteID; JobNo, JobDetails.

 

How can I get PowerApps to show SiteName instead of SiteID on browse screen or edit screen?

 

I used Dropown box for SiteID, it is displaying SiteName but is same for every job I add (although in Jobs table, SiteID is shown corectly).

I hope I made myself clear enough and i hope also we can find a solution for this, because this is a common scenario I believe.

 

Thank you very much.

hpkeong
Level 10

Re: Drop down box question

Hi

 

I am equally new in PowerApps and just try to share the CLUES, not solution.

(When I saw your message, I stopped my car at a safe road-site to draft a complete Road-Side clues.)

 

I tried to  show a complete example:

Use this please:

- LookUp(TableSite, SiteID = ThisItem.SiteID).SiteName

 

When I used DropDown, it is only a clue.

- SiteID refers to SiteID in TableSite.

- ThisItem.SiteID refers to SiteID as in TableJob (which is the Gallery.Items - TableJob)

 

The following is to show ALL fields for easier perception.

You can then drop those unwanted fields and it will not affect.

 

Screenshot (94).pngComplete FormulaScreenshot (95).pngSample Tables

 

 

Hope this helps.

hpkeong
LucianB
Level: Powered On

Re: Drop down box question

Hi hpkeong,

Your answer is much appreciated, I don't have any issues with  your clues! Moreover, your clue from last reply may work , I will check tonight.

 

I am waiting for some answers from Powerapp staff, as I honestly believe online documentation is not at all comprehensive.

I can understand they can't cover everything, but my problem is related to a very basic requirement which should be properly explained.

That because I still believe Lookup is not a proper way to do this - takes ages to load.

hpkeong
Level 10

Re: Drop down box question

Hi

 

Thanks for your comments.

My Sharing of using LookUp (and any other formuals)

- LookUp will start to MATCH SiteID = ThisItem.SiteID to find and get/show SiteName

- This will be processed through all the records and will slow down, I agree. (PG Staff has shared and given me such a clues).

 

Hence, My idea for you

- When you are selecting SiteID, using the same LookUp to get the SiteName from TableSite, then only SAVE.

- Eventually, you are SAVING SiteName, NOT SiteID (if you wish to save SiteID, it is still OK) into your TableJob.

- In this case, your TableJob will have SiteID (if you wish), SiteName, JobNo, JobDetails.

So, when use Gallery to show all data, it will not involve any Processing of Data.

 

I wish this may further clarify the reason why.

Wish PG can help.

hpkeong

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 (5,541)