Need help pulling a value from one database to update another

I have two databases in my app which keeps track of Users and Companies that are using the app.

What I want is for each company to be given a company ID which is then assigned to a user when they sign up, ie,

Company A has an ID of C1001, when a user signs up and states that they work for company A, the ‘Company_ID’ datatype is set to C1001 in the Users database.

When a user signs up, they are given a dropdown list option of all the companies currently in the database and they have to select which company they work for. The workflow to assign the correct Company_ID to the Users database in plain english is as follows:

Search the Companies database for the value of the input box asking ‘What company do you work for?’ and then looking for that value’s Company_ID. The constraint looks like this: Company_Name = inputCompany’s value’s Company_ID

However, this brings up an error that states that it evaluates as a list and not a value.

When debugging I can see that the program is indeed finding the correct Company_ID (C1001) but is not setting this number as the User’s company ID in the user’s database.

I’m new to bubble, and new to asking questions but am hoping someone might have successfully implemented a similar function before and is able to notice where I am going wrong.

Hi there, @thomas.hayward… if I understand your post correctly, try adding the :first item operator to the end of your search expression, and I think you should be good to go. Oh, and make sure any privacy rules you have in place on the Company data type don’t get in the way of what you are trying to accomplish.

Hope this helps.