Creating a database entry with a pre-filled field

I have two Data types - Company and Job Post.

Company data type contains the following fields

  1. Company name - Text
  2. CEO - User
  3. Location - Geographic address
  4. Employee - List of users

Job Post data type contains the following fields

  1. CEO - User
  2. Company name - Company
  3. Employee - List of users
  4. Job disc - Text
  5. Category - Text

I want to allow the user to create a new job post by entering the data. For this I created a new page with Type of content as user where I created input forms and a button. With that button I tried creating a workflow to create a new Job Post. I am able to create a new Job disc field but not the Company name and CEO field. I have attached a screenshot below.

What am I doing wrong?!
Screenshot%20(70)

You’re mismatching data types. CEO is expecting a user, but you’re trying to pass it a Company Name, which is a text.

Similarly, on the “Company Name,” you’re trying to feed it a text, but it’s expecting a “Company.”

There is no option showing up to select User instead of Text when I open the edit input form dialog box. However, for the type of content of the whole page, I have selected User as the type of content. I have attached the screenshots below.

Sorry if I am making a newbie mistake

The issue is in the data type set up, and the page data type. I assume you have a page that shows jobs in a repeating group, and the user clicks a job, which sends them to a page with the job description and allows them to apply?

If this is the case, the page type should be a “job”. The job would have data fields:
Name: text
Company: company
Position: text

When you run the workflow, then, you could reference the CEO by doing “current page job’s company’s CEO”. And also fill the company field using “current page job’s company’s company name”.

1 Like

I am creating an option to create a new job post. I want to allow the user to create a new entry to the database. The job description part is being updated but I can’t figure it out for company name and CEO name. If I keep the CEO name as the Current User then that works but I want the option to select a name from the database already created.

https://bubble.io/page?type=page&name=add_job&version=test&id=qwsdfvbnkjhgf&tab=tabs-1

As for the page and data type, I have tried setting the Page type as User, Job Post and Company with no success. And this is a separate page and no navigation had been setup (i.e. what type of data to send was not specified) but I have tried that as well.

OK. I think I get what’s happening now. I’ll walk you through it. First, here’s the end result and I’ll show you how to get there.

Ok, so what we want is to create an interface where users can post a job. We want them to type in a company name, and have the CEO name pre-filled. We then need them to enter a description and a category, and create the job. From there, we have a list of posted jobs, where users can click on a job to see the details.

Let’s start with the data types. I looked at the link you posted, and here’s how I’ve structured it. I haven’t touched yours, just built my own.

User Data type:
user%20data

Company data type

Job post data type
job%20post%20data

Editor page. Do not set any data type on the page.

This is the “New Job” group, where the user creates the job. Set its data type to job post. We aren’t going to feed it data, we’re just doing this to reset the group for another job post when we’re done.

Change the “Company Name” element from an input to a search box. This will allow all companies that meet the user’s input to display. The user clicks one, which populates the field, and pulls the data from that company to pre-fill the CEO input.

We can see in the dummy data for this company i’ve created, that we have a user “Tony” as the CEO.

When the user begins typing the company name, it appears in the search results. They click the correct company, and the CEO box is filled with the CEO user’s name.

company%20filled

This is done by setting the initial content of the CEO input to the Search Box’s company’s CEO

enter%20ceo%20name

When our job is created, we run this workflow

We then have a Repeating group that displays the jobs, and a dropdown for category that we can filter from.
RG%20Jobs

Hopefully that will help set you on the right path. I can give you more details later, if you need.

2 Likes

Thanks for this detailed guide. Just one more thing. How do we save the employee’s name in the job posting? I mean when we are creating a new Job Post.

Employee = Input Enter employee’s name’s value ? This shows an error.

And the company name is being saved as an ID and not the company name.

Side note: is it possible to select one out of the many employees? Let’s say one person is HR and the other is Ops guy and I want to add only the HR guy by choosing from the options. Right now all the employees are being added.

It’s giving an error because the employee field is expecting a user, but you’re giving it a text. You’d have to use something like Employee=current user. Assuming the user is logged in.

As for the company name, in your data section, select the primary field to shown company name, rather than ID.

It’s possible to select only certain employees. You can do this in several ways. One would be a drop-down that shows a list of employees, and the selected value is added to the list of employees.

Another would be a multi drop-down that adds a list of selected users.

Yet another would be a repeating group with a custom state that adds a selected list of users.

It might be easier if I knew the end goal you want to accomplish. Is this a public job posting site, like Indeed? Or an internal tool where only people from certain organizations will use it?

You’ll just need to structure the data types to best suit the goal you have in mind.

I am just trying out different things and understanding the functioning of Bubble.

And dropdown option is working. Will try RG as well but won’t we have to provide a way to assign states before a user begins with the Job Post process ? Thanks. I know I have asked a lot of questions

All good. Questions are how we learn. You would need to assign a state to the repeating group. Yo don’t need to do it before the process begins. It can be at any point, depending on what you’re trying to accomplish. @romanmg has a really good video on building a list with a custom state, which you can find here. When in doubt, I usually just ask myself what Gaby or @NigelG would do. It’s worked so far.

2 Likes

Hi jcindy,

This may seem overly silly but i have been trying to read for the past few days or find a video of some sort that will show me how to prefill a users info after sign up /login. If you could point me in the right direction to find some material to read id really appreciate it.
Just a side note…My email prefills and shows once user is logged in but when i try to follow the same steps to pre fill the first and last name it never loads in. I have to keep manually inserting the first and last name and then it saves after refresh but from a users perspective this might be a little annoying so i am trying to prefill these inputs after their initial sign up

Hi quickc, you may want to kick up a new thread for this. As a quick assist, you should be firing a SIGN THE USER up action where you can set the first and last name on the user table simultaneously. You should NOT try and insert just a first and last name into the user table. This is essentially telling Bubble to insert a brand new user row into the table. What you want to do is establish a user row via SIGN UP and then just make updates to that row. If this doesn’t help, please spin up a new thread and add more specific details/screenshots to help assist.