Setting up Job datatype which refers to subordinate datatype

I think I have just got it working.

The ‘save invoice’ button on group ‘create-invoice’ needed to store the linked Job to the database which I found difficult seeing as ‘create-invoice’ was set Invoice. The trick was to refer to the previous groupjob-invoices' s Job (this works because it has a Job data source).

The `job-invoices’ group has a RG of jobs and thankfully Bubble knows which Job’s invoices to display (I don’t know how but I’m not complaining!).

I wish data sources were not required by Bubble because they cause all my headaches. For true ‘no code’ coding I would like to click a link which might ask if I want to link to a page or send data to the DB. Then, it would ask what part of database you want to send to (or retrieve from). That’s it, no need to syncing data sources.

That said, the support on this forum is fantastic and I haven’t given up because of a few people, @adamhholmes being one who have taken the time to help me.

I spoke too soon, I am still (after 2 weeks) unable to sort this out because I can’t go from a Job data source to an Invoice one. See below, the ‘manage-job’ is type Job but the next page ‘Job-invoices’ is type Invoice.

Screenshot 2022-03-08 162210

I have booked a phone consultation with a (paid) freelancer tomorrow so maybe I will finally get this sorted, it’s the 4th time paying for help so not holding much hope!

I have been given tons of advice and every single attempt partly works but never actually fully works.

Here’s an editable copy of my site, important groups which need attention are;

create-invoice
job-invoices
FG bottom action button (save invoice button)

https://bubble.io/page?name=index&id=public09032022&tab=tabs-6&subtab=General

Final thought, I am not sure what the point of a ‘List of things’ is because my previous website displayed as maybe Invoices as needed in a repeating group even when not stored as a List. In fact, I found ‘Lists’ had disadvantages because you need to refer to a specific Invoice, whereas with single Invoices I can reference ‘this invoice’ in a RG. Just much simpler, but I realise I am probably wrong here as there must be some use case for a List - my guess is that Lists are for non-repeating group usage.

Another update: After a lot of trial and error I have got it to work (not fully tested yet) but wondered if someone could say if I did the correct thing. I have made the data on job-invoices and create-invoice (both invoice data source) refer to manage-job's Job (which is Job data source).

Screenshot 2022-03-08 162210

1 Like

I am finding this to be an issue because I need to pass data from ‘my-jobs’ to ‘create-invoice’.

Why do you need to do that?

As a user of my app you would want to view/create invoices which are linked to a specific Job. The page below shows one Job, you see that Job’s customer, invoices, expenses etc. If you click on ‘Invoice’ you need to see the Job’s invoices.

Sure, but you don’t necessarily have to set a content type and send data to a group to do that - as you’re using a single page app you can access any data from anywhere you’re referencing it elsewhere on the page.

In any case, if your database is set up correctly it should be very simple to ‘send’ data from one group to another - just refer to the relevant field on the parent group’s thing (or if need be do a search for it).

I’m not sure what you mean by:

Need to send this Job’s data to Invoices (which is a datatype Invoice)

If the content type is Invoice then how can you send Job data to it? (you can’t)

Or do you mean send the Job’s Invoice? Which is simple.

It’s not clear what you’re trying to do, or why you’re having difficulty with it…

For clarity, here is a step by step showing why I am stuck.

Let’s suppose I am a user of my app and I am a builder.

Step 1 - I have created a new Job to fix the bath and my customer is Bob Smith. I will now click on the white cell to see the details of this Job.

1

Step 2 - Ok, I see that I have multiple options for this Job. I can Invoice Bob Smith, send an Estimate to him and more. I will now click on Invoice because I want to send Bob Smith an invoice for work done.

Step 3 - I haven’t created an invoice yet so the page is empty. I will now click on the top right ‘+’ icon to create a new invoice for this Job.

Step 4 - I would like to see the invoice pre-polulated with the customers name ‘Bob Smith’ but I can’t figure out how to do this?

It seems important that this invoice is ‘linked’ to the Job because if the user later returns to Step 2 they will want to see the Invoice(s) which are linked to the Job ‘fix the bath’.

Here is how I tried to refer to the Job’s customer which doesn’t work. I need to refer to the Parent groups Job’s customer (which is impossible due to the parent group being Invoice). This is why I wish Bubble didn’t use datatypes.

5

Just set the initial content of your input to the Job’s Customer’s name. It really is that simple.

There will be no input, I want to show the customer name as Text. The white input you see is a normal group only. I also want to show the Job’s title and many other details which relate to the job. So, the invoice must link (somehow) to the Job which it comes from.

Then just use text elements.

I can’t refer to the Job so how can I get the ‘Job’s customer’s first name’? Honestly this is much harder than it seems because I’ve tried for 2 weeks and 2 freelancers can’t do it. This is why I changed the database twice.

You’re already referring to the job (you have to be in order to show the Job’s invoices). So just refer directly to that.

Plus, surely you’ve got a field on Invoice For Job? So, if you’re editing an existing invoice refer to the invoice’s Job (although there’s no need to do that when you can just refer directly to the Job you’re working with)

Please, show me the workflow that you trigger when you click the “+” button to create the invoice.

I am not referring to the Job’s invoices, this is the issue that I want to fix. I can’t refer to the Job’s invoices because the Job has a datatype of Job and Invoice has a datatype of Invoice.

Then why not? That’s what you need to be doing (how else are you going to display the invoices?)

So how are you currently displaying the invoices for the job? Or are you saying that you’re not (that’s what you can’t do?)?

This is why for two weeks I have been trying to learn ‘how’ to do it… ! I would love to refer to the Job’s invoices as it would solve all my issues. But I don’t know how to.

And? What happends after you go to index?

Correct. I am not displaying them and I don’t know how to.