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
v-jefferni
Community Support
Community Support

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
v-jefferni
Community Support
Community Support

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,468)