Add and remove row of fields / Invoice maker page

I’m making an invoice maker page and need to have the option to add and remove aditionnal items to an invoice.
On page load, one row of fields is shown (each row consists of : quantity, description, price per unit, total and a toggle for taxes or no tax)

I’m not sure how I should build that.
Should I make 10 rows, hide 9 of them on page load and make a + and - button associated with each row?

Or is there a way to make this work in a Repeating Group?

Or any other way?


Just create a new item when the + button is clicked.

Thanks for the quick answer. So that would be in a repeating group. I would be creating a new item, with all fields being empty, and then the page would act as an edit to this item once the invoice is saved. Is that correct or am I wrong here.

Sounds pretty good to me…

Then, should the items have their own data type? Otherwise how I’m seeing it is that I need to create for example 10 set of empty rows (50 fields) per invoice DataType.

Yes new data type called Invoice Item, with a field called Invoice (type Invoice) so it has a reference back to it’s parent Invoice. Then your repeating group will be Do a search for Invoice Item with a constraint Invoice = [your page's invoice or whatever].

When you press the add item you create a new Invoice Item, and set it’s Invoice to the page’s Invoice

Yeah I think that’ll work, I’m trying it now

1 Like

Ok I’ve been messing around and can’t figure it out. I think this last idea by Tyler doesn’t fully work because the Invoice Item I am calling in the RG doesn’t exist yet.
This is rather how it will be used to edit the invoices when calling already filled fields.
I think I rather should create 10 blank Invoice Items in the database (with some sort of ID that can be matched with the invoice) and then on pressing of + button it displays(Workflow show) the next field and - button (Workflow Hide) the next field.

If someone could tell me if I’m in the right direction or if I got something wrong I’d highly apreciate it.

Nono don’t do that, just make the Invoice first, so then you can create the Invoice Items after. The point of adding the Invoice field to the Invoice Item is to create that link you are looking for.

If you’re talking about making some “pre-made” empty Invoice Items at the time of Invoice creation, then in your workflow have the create Invoice Item actions (like a few of them, 10?) and each of their Invoice fields will be Result of step [your Create an Invoice action]

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