How to create new rows of a thing from a RG of another type?

Please pick a subcHi guys
I need a suggestion to do this workflow:

I have a type called “Product” with fields “Name” and “Price”. and another type called “ProductsBought”
Then I have a button “BUY”. Now when I click it I want create in table “Products Bought” as many rows as there are products.

Then, I have a RG containing the products, a button that should start start the workflow. This workflow should create as many rows as the are producuts.

I try to use a WOrkflow API but I could not get it to work correctly.

Is it possibile? Do you have a suggestions? :slight_smile:

Thanks
Elisabetta

Morning @anyverse

Can i see your RG and the workflow ?

Hi, thank you for rapid reply.

I send you my link editor (in view). So It’is more easy to see what I did.

In your repeating group for products bought you should have a data type of product and have source be a search for products bought each items product.

In your database make sure you have a related field to Product in the Products Bought data type.

Thanks,
you mean like in this :point_down:

but the workflow how can do it?

Thanks…

I don’t really understand what you did.

You have a list of products that appears in your RG.

You want to make a product purchase. so far there is no problem. But how do you know which products to buy?

I want to buy all the things in the RG product AND Everything bought must appear in the table Products.

Then If I have 4 product in RG Product when I click “buy” I should Have in table ProductBought the same product of RG product.

Well, you can do anything:
you create in your type “product bought” a field “products” which is a list of “products”

then you configure a workflow:

when buy button is clicked:
create a new product bought:

  • products add list repeating group’products
    -creator = current user

I don’t think you necessarily need to do it in the backend

When you do Step 1 to Schedule API Workflow on a list, make sure the type of things is set to Product.

There may be a lot of things going wrong here.

You should look into how to use backend workflows, as well as parameters, data types, and database design.

Thanks guys for your suggestions.

But maybe the plugin called “list sfifter karma-ware” can help me.

I will try It and then I will let you know :slight_smile:

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