Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Create new list based on combobox in power app

(0) ShareShare
ReportReport
Posted on by 133
Hello, 
 
I have to create an app which users can enter new project and choose what product will be affected in.

After chasing products( it can be one or more ) I need to create another list where my products will be as separate rows in table, is that possible ?
  • Suggested answer
    Create new list based on combobox in power app
    yes, colpics holds the collection of the children.
    Step 1: Create the record for the Project (Parent)
    Step 2: select the products in the Products (Child)
    Step 3: Press Save button
    You can save the Parent at the end of Step 1 or during Step 3, as long as the Key is available.
     
    Set(Key, Now()& "Project Name");
    ClearCollect(colProducts, ComboBox1.SelectedItems);
    ForAll(colProducts, Patch(SharePointList2, Defaults(SharePointList2), {
        Title: Key,
        Product: ThisRecord.ProductName
    })
  • Karolina776 Profile Picture
    Karolina776 133 on at
    Create new list based on combobox in power app
    @DreamCatcher "colPics" in your formula is the collection based on combobox ? I think I need more step-by step tutorial to understand all steps correctly, for know I do not understand how I can do it for every choice from combobox.
  • Create new list based on combobox in power app
    Here is the Patch statements I used:
      
    ForAll(colPics,Patch('All-ENHA-Report-Records',Defaults('All-ENHA-Report-Records'), {
        Title: Title,
        JobNumber: JobNumber,
        JobName: JobName,
        RowNo: RowNo,
        Photo:Photo
        }));
     ForAll(Filter(colPics, ID=1),Patch('All-ENHA-Report-Key', Defaults('All-ENHA-Report-Key'), {
        Title: Title,
        JobNumber:JobNumber,
        JobName:JobName,
        ProjectName:textJobDescription.Text,
        Date:Text(datepickerPVF.SelectedDate, "yyyy-mm-dd"),
        InternalNotes: textInternalMessage.Text
     
     }));
  • Create new list based on combobox in power app
    SharePoint is not really designed to be a database. HOWEVER, there are work arounds you can use to make this work.  You will need 2 tables. 
    Table 1 Is the Parent.  This will be for the Project. 
    Table 2 is the Child and will be for the Products.
    When you set up Table 2 include a column to reference Project table.  You can use a Lookup column or a text column.  I used Text columns and it worked just fine.  If you use a Text field you will have to keep the relationship yourself, while a Lookup will hold the relationship.
    You can see in the screenshots below I used a unique key I created in the app to relate the tables and populated the Title column with this information.
  • Karolina776 Profile Picture
    Karolina776 133 on at
    Create new list based on combobox in power app
    @DreamCatcher as a data source I use SP list now. TO be honest I do not have an experience with another data sources
  • Create new list based on combobox in power app
    Yes, in the app, make each Product entry a row in a gallery. Then when you create the records you will create a parent/child relationship between the project and the product.  What is your data source?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard