Search Input - Possible to Save New Entries?

I am trying to make it easier for companies to find existing companies in our database. I have done the following:

  1. Created a form with “search” input.
  2. It searches nicely and finds all companies.
  3. There is no way to save it to the data base.

The only way it will save is if the company exists already. I have checked off the box to allow new entries.

It will never save. Any ideas?

You would need a workflow where this is a Create a Thing (company) and it would have a condition that says Only When … Do a Search for Input’s value:count <= 0

Hi Patricia,

Correct. That is exactly what I have done. When x < = 0 then it creates the new company. It will save the name, the creator, etc.

It will never save the company though.

On the flip side of things if X>0, then it save nicely. Any ideas?

What do you mean it will save the name and then you go on to say it will not save the company?

I will make a video a bit later. This is difficult to explain in words. Thanks for getting back to me so quickly

It’s late here now so I won’t to get to look at it tonight. I’ll check back in the morning and see if you’re still stuck. However, if you could explain to me what the difference between ‘name’ and ‘company’ is I might be in a position to suggest something before I close down for the night. By Company do you mean a Thing as in a DB Table?

Please ignore previous comments about “name” and “company”. Users are all associated with a company.

I have changed an input field on the sign up from: regular input field -> search input field. The reason is if there is an existing company, I want the search field to populate.

When I use the function: Company Name = Input - Company’s Name’s Value it won’t save. It’s red.

I have used the function: Company Name = Input - Company’s Name typed text and it’s red now although this works fine on the page = /login. I have used this before and it works fine. Now it won’t work.

STEPS

  1. Add new user with a new company. The user and company save fine. This works.
  2. Add a new user with the company in Step #1 (so it’s like a co-worker). The company doesn’t duplicate which is perfect. The problem is our new user is unable to save the company from step #1.

I need this to save because you can have more than 2 people in a company. Does that make sense?

It makes sense this time and I know I’ve had that exact problem before. I would love to dive in for you but I really need to close down now. Before I go I’ll make a couple of suggestions that might be worth at least eliminating.

  1. Don’t save the search box value, save Current Page’s Company
  2. Insert a pause (under Navigation in Actions) to see if that helps.
  3. Make a hidden input’s value = to the search box’s value and save the input.

I suspect it is one of those bothersome bubble problems that takes experimentation to solve. Good luck and I’ll check in tomorrow to see if you are still stuck. You may need to make your app ‘Everyone can view’ and let someone jump in for a look. That’s often the fastest way.

I think this will show it best.

When a new company name is typed in, Search box’s value is empty, typed text is the new name.

Conditional workflow steps should be create the company as you have it, then change the user and set the company to the one just created in the previous step.

When an existing name is typed in, change the user as you do now to the search box’s value. This should not be done on the condition of a new company name.

Your video made it a lot clearer : )

1 Like

Yep @mgray the video was great but what was even better was discovering @mishav is working while I sleep and has you covered :slight_smile:

Step 2. It creates the company with “typed text”.

Step 3: I haven’t changed the company as you said it was correct and I agree. I have now set the next step to change based on the company that was created. It’s blue, seems correct, and still doesn’t work.

Step 4: This is independent of Step 2 and 3 above as the company exists in the system and uses the “search box company value”. This seems to be working.

The only step that isn’t working is Step 3. Can you sign into my backend and check it out?

It’s on the page /login. Thank you for your help!

@mgray very close!

Step 2: Change the condition to SearchBox - Company’s value is empty

Step 3: add a condition SearchBox - Company’s value is empty

Step 4: add a condition SearchBox - Company’s value is not empty

Steps 2 and 3 are for a new company. Step 4 is for an existing company.

1 Like

@patricia & @mishav Thank you for your help :slight_smile:

@mishav The way you explained the answer in your last post was super, super clear. Thanks again for all you effort!

1 Like

@mishav Ready for another challenge :slight_smile: