cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
Microsoft
Microsoft

Hi @Anonymous ,

 

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
Microsoft
Microsoft

Hi @Anonymous ,

 

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (46,682)