cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VinnieS
Frequent Visitor

Create Multiple Records at one time with 2 or more checkbox galleries

I am trying to figure out how to create multiple records in my database at one time. A simple way to put it, we sell shirts. I have created the whole inventory system and it works great. However, putting in items takes a long time. For example: if one shirt has 3 colors and 5 sizes then I will need to input 15 items.

 

I think the best way to do it is to have a custom card in my form for Size and Color. It would hold a gallery of check boxes for each card. When filling out the info of the item, I would like to check off the POSSIBLE colors and POSSIBLE size....then somehow go to a collection...then somehow create the 15 items needed....

 

 

If there is a better way to do this, please let me know.

1 ACCEPTED SOLUTION

Accepted Solutions
v-albai-msft
Microsoft
Microsoft

Hi @VinnieS ,

Based on your description, I did a simple test on my side, you can refer to my formula(you need to edit my formula to meet your own requirement):
1. Create a list to keep the records. My list called “bulkpatch” with two Text columns called “Color1” and “Color2”:

v-albai-msft_0-1614767230709.png

 

2. Create two combo boxes with below choices(these two combo box allow multiple selection).

v-albai-msft_1-1614767230713.png

 

v-albai-msft_2-1614767230716.png

3. Add a button under the combo box, set its OnSelect property to(ComboBox1 and ComboBox2 are the name of my two combo box):

 

ClearCollect(colorcol,ComboBox1.SelectedItems);
ClearCollect(sizecol,ComboBox2.SelectedItems);
Ungroup(ForAll(colorcol,
        ForAll(sizecol,
             Patch(bulkpatch,Defaults(bulkpatch),{Title:"T-shirt1",Color1:colorcol[@Value],Size1:Value})
        )
    ),"Value")

 

Check results this time.

When I select 3 color choices in first combo box and 5 size choices in the second combo box(you can select different number of choices), then click the button, my SP list will have 15 new records:

v-albai-msft_3-1614767230718.png

Best Regards,

Allen

View solution in original post

4 REPLIES 4
v-albai-msft
Microsoft
Microsoft

Hi @VinnieS ,

Based on your description, I did a simple test on my side, you can refer to my formula(you need to edit my formula to meet your own requirement):
1. Create a list to keep the records. My list called “bulkpatch” with two Text columns called “Color1” and “Color2”:

v-albai-msft_0-1614767230709.png

 

2. Create two combo boxes with below choices(these two combo box allow multiple selection).

v-albai-msft_1-1614767230713.png

 

v-albai-msft_2-1614767230716.png

3. Add a button under the combo box, set its OnSelect property to(ComboBox1 and ComboBox2 are the name of my two combo box):

 

ClearCollect(colorcol,ComboBox1.SelectedItems);
ClearCollect(sizecol,ComboBox2.SelectedItems);
Ungroup(ForAll(colorcol,
        ForAll(sizecol,
             Patch(bulkpatch,Defaults(bulkpatch),{Title:"T-shirt1",Color1:colorcol[@Value],Size1:Value})
        )
    ),"Value")

 

Check results this time.

When I select 3 color choices in first combo box and 5 size choices in the second combo box(you can select different number of choices), then click the button, my SP list will have 15 new records:

v-albai-msft_3-1614767230718.png

Best Regards,

Allen

View solution in original post

VinnieS
Frequent Visitor

I am having issues with this part

Color1:colorcol[@Value],Size1:Value})
        )
    ),"Value")

I am not understanding the [@value] and Value and "Value" parts...
Why does size not have the sizecol in it?
I have tried the code with my DB names, however it doenst work for me.

VinnieS
Frequent Visitor

VinnieS_0-1614781042789.png I changed some of the collection names to match what I normally do. The errors are:
"The type of the argument "crdc3c_color1" does not match expected type "Text". Found type error.
name isn't valid. This identifier isn't recognized.
The function 'Patch' has some invalid arguments"

 

VinnieS
Frequent Visitor

Never mind...I did my research and I think it is working.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (61,733)