Create a new thing with a collect data from a repeating group

Hello,

First step, I’ve create a repeating group with all my client, when I select a client, his name come into an input who collect his name.

After, I want to create a new thing : an invoice

But when I select the input name client value or the custom state that I created to collect his name : bubble send me an error : value should be a client but right now it is a text.

someone now how to fix that ?

Thank you all !:ok_hand:

What’s the content type of your input? It’s probably text. Change that to the relevant data type i.e. client

If you already have that and the issue still persists, how are you “collecting” the client’s name? Are you using the data type client in your custom state or just a text? If it’s the latter, change it to client

Hope this helps

hello ntabs,
i change my custom state type to client, but I can’t change my input type to text from client

Apologies. Must have had a brain fart.

This is the expected behavior. You can’t use data types for the input element’s content type

When you create an invoice just reference to the client’s name by using client’s name.

Just simply reference to the state’s client value. You would then use the client’s name assuming your invoice has a text field for the client name.

If I understand correctly : in my data base, I create a relation in data invoice like : client type is client.
But, if I have to change the client type to text ?
Because, when i did that, it’s work, this will not broke the others things ?

How does your database structure look like for your invoice data type look like?

I’m french, i don’t know if you will understand but here is :

If I understand correctly, you want to reference to the client’s name in the invoice, correct?

if you have a text field called client name in the invoice, you could just use that. If not, you could reference to the client’s name in the invoice since you already have a client field in your invoice.

Just use a searchbox element instead of the input…make the searchbox element have a dynamic choices and be set to your data type of Client. Set the appropriate data field to search (likely name_full)…then when you want to use the selected value to create an invoice, no need for custom state, just use the searchbox selected value.

Bonus, if the client searched in the searchbox element doesn’t exist, you can use search box element type text value to start creating a new client to use for creating the invoice (note: this is a complex feature, the details of implementation I have not gone into; just an idea of how to utilize the searchbox feature to create more user functions/features that lead to better UX)

Thank you for your help I will try this !

Hello, amazing it’s really simplest thank you really much !
Have you an idea how can I can create a new client with the searchbox ?
In any case thank you really much

Do a conditional workflow trigger, when searchbox element typed text is not empty, and have workflow action to create the client.

You might also try workflow trigger, when input element is changed and select the searchbox element and put a condition onto the trigger ‘when typed text is not empty’ and run workflow steps to create client.

I’m not 100% sure about whether or not the second approach is possible as I’m not sure if Bubble registers the search box element value as changed only when a selection is made and not when only typed text is present

This topic was automatically closed after 70 days. New replies are no longer allowed.