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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (52,479)