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

get id form existing SQL row

Hello, So i am working on an app where on the welcome screen you have to set a traject number and choose to create a new project or work with an existing project. I have 2 tables, "dbo.Project" and "dbo.Traject". The traject database has a column projectID which contains the ID of the project database. so if you choose a new project the following happens. 

 

 

 

 

Set(projectID; Patch('[dbo].[Project]'; Defaults('[dbo].[Project]'); {naam: projectNaam; datum: Today()}))

 

 

 

 

 

 

 

 

 

Patch('[dbo].[Traject]'; Defaults('[dbo].[Traject]'); {projectID: projectID.ID; trajectNummer: txtTrajectNummer.Text})

 

 

 

 

 

But imagine there is already an existing project created just like this. I want to have the projectID, in the traject table, set to the project's id that already exists. Can you guys help me? Thanks in advance!

 

Edit: you can choose an existing project with a dropdown.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Hi @DannyVerdel ,

 

Do you want to let user select a project in a dropdown which contains all project belong to current traject?

 

If you do, you could set the dropdown's Item property to 

Filter('[dbo].[Project]',ID in Filter('[dbo].[Traject],trajectNummer = txtTrajectNummer.Text).projectID)

Then you could use Dropdown.selected.naam or Dropdown.selected.ID as selected project name or project ID to update.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
Highlighted
Microsoft
Microsoft

Hi @DannyVerdel ,

 

Do you want to let user select a project in a dropdown which contains all project belong to current traject?

 

If you do, you could set the dropdown's Item property to 

Filter('[dbo].[Project]',ID in Filter('[dbo].[Traject],trajectNummer = txtTrajectNummer.Text).projectID)

Then you could use Dropdown.selected.naam or Dropdown.selected.ID as selected project name or project ID to update.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (6,976)