Linking data of a dynamic item page to a field of a form

Hi, I’m in the process of creating a job board website.
I want to include a job application form in order to let the users apply for jobs through my website.
Firstly, users can select a job from a filtered list and he/she can click a button to view the details of the selected job by directing to a dynamic item page. I want to add an “apply” button in this dynamic item page giving a link to the job application form. Here I want to include the job ID automatically in this form, so that once a user submit the form, Job ID will automatically be updated in my job application dataset.

My Question is - How can I set the Job ID to be automatically included in the job application form?

Hello thiliniprasangika11,

you do not give enough informations.

  1. Which DATABASES are used in this process? (DATABASE-A+DATABASE-B?
  2. On which of your pages is your “Job-Application-Form” located?
  3. In which DATABASE is stored your “Job-ID” ???

It yould be very useful to show pics from the relevant database-structure and eventuelly also a pic of your dynamic page and “job-form”.

Hi, thank you very much for your response. Here are the answers

  1. I’m using two databases,

  2. Database(I) - Contains job details including Job ID

  3. Database(II) - This is to store data from submissions of job application from

  4. Job application form is in a separate page.

  5. Job ID is there in Database(I)

Ok, then if i understood everything right…

  1. DATABASE-A connected via a DATASET with your DYNAMIC-PAGE.
  2. In DATABASE-A you have stored your “Job-ID”.

That means, every time when you choose a job from your Drop-Down-List, you will be redirected to your “Dynamic-Page”, where you also show the “Job-ID”.

So in this case, you already have the ID…

$w.onReady( () => {
  $w("#YOUR_DYNAMIC_Dataset").onReady( () => {
    let itemObj = $w("#YOUR_DYNAMIC_Dataset").getCurrentItem();
    console.log(itemObj)
    console.log(itemObj.items)
    console.log(itemObj.items.title)
  } );
} );

Modify the code by your needs. DATASET = your dynamic-dataset.
This code will give/show you all infos about the current selected item.

Take a look into CONSOLE in PREVIEWMODE (very bottom of the screen),
or press F-12 on keyboard when you are using GOOGLE-CHROME and go to —> CONSOLE).

First step done.

Further you also know the current selected index in your dataset, if you are using a Drop-Down.

Index of DropDown = Index of selected item in DATABSE

Now you have an “Apply”-Button on your dynamic page. When pressing the button you want to be redirected to a special page (NON-DYNAMIC-PAGE), where you have the “Job-Form”…

…and where you wants AUTOMATICALY load the ID into FORM…

$w.onReady( () => {
      myForm.value = the ID i already have got before
})

Now you should have the ID in your form.

And at least, you have a “Submit”-Button, which lets the ID be saved in DATABASE-B…(for example like this)

$w.onReady( () => {
  $w("#YOUR_Dataset").onReady( () => {
    $w("#YOUR_Dataset").setFieldValue("column-ID", "ID.value of the ID-INPUT-FIELD here");

  } );
} );

Something like this would be the theoretical way to a solution.:sweat_smile:

@russian-dima I’m trying to do this at the moment with my website but I am a complete novice when it comes to coding.

Would it be possible for you to walk me through this process step by step i.e. explain what part of the code needs changing and on which page it goes on?