Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Table / Selection

(2) ShareShare
ReportReport
Posted on by 6
Hi all,
 
I am trying to create the attached snip in power apps, this will go to a SharePoint list, however, it all needs to go into the same row as the rest of the information which is done via a form control. How would I create something like this?
 
 
  • Suggested answer
    SwatiSTW Profile Picture
    SwatiSTW 306 on at
    Table / Selection
    @CU25110323-1 
    To make the labels selectable and bind them to a SharePoint Choice column, you can replace the static label with a Dropdown control. Here’s how you can implement it step by step
    1. Replace the Label for ImpactAssessment in the gallery with a Dropdown control.
    2. Set the Items property of the Dropdown to the choices available in the SharePoint column. For example:
    Choices(SharePointListName.ImpactAssessmentColumn)

    Replace SharePointListName with the name of your list and ImpactAssessmentColumn with the name of your SharePoint choice column.
    3. Set the Default property of the Dropdown to:
    ThisItem.ImpactAssessment
    4. Use the OnChange property of the Dropdown to update the value in the collection when the user selects a choice:
    Patch(TableData, ThisItem, { ImpactAssessment: Dropdown_ImpactAssessment.Selected.Value })
    5. When saving the data back to SharePoint, ensure the ImpactAssessment column in your SharePoint list is set up as a Choice column. Use this code to save the data:
    Patch(
        SharePointListName,
        Defaults(SharePointListName),
        {
            OtherField: OtherFormInput.Text,
            ImpactAssessment: TableData, // Flattened data if needed
            TableDataColumn: JSON(TableData)
        }
    )
    This way, the ImpactAssessment becomes a dropdown tied to the SharePoint choice column, ensuring the values are properly saved and compatible.
  • CU25110323-1 Profile Picture
    CU25110323-1 6 on at
    Table / Selection
    @SwatiSTW this should work fine but how do I get the labels to be selected? The column is currently a choice column in my SharePoint
  • SwatiSTW Profile Picture
    SwatiSTW 306 on at
    Table / Selection
    1. Create a collection to store the table data temporarily. Use this code in the App OnStart or a button's OnSelect property:

    ClearCollect(
        TableData,
        { ImpactAssessment: "Management", Manhours: "", Cost: "", Quantity: "" },
        { ImpactAssessment: "Design", Manhours: "", Cost: "", Quantity: "" },
        { ImpactAssessment: "Construction", Manhours: "", Cost: "", Quantity: "" },
        { ImpactAssessment: "Material", Manhours: "", Cost: "", Quantity: "" },
        { ImpactAssessment: "Subcontractor", Manhours: "", Cost: "", Quantity: "" },
        { ImpactAssessment: "Schedule", Manhours: "", Cost: "", Quantity: "" }
    )
     
    2. Add a vertical gallery and set its Items property to:

    TableData

    3. In the gallery, for each row, add a Label to display ImpactAssessment. Set its Text property to:
    ThisItem.ImpactAssessment
     
    4. Add Text Input controls for Manhours, Cost, and Quantity. For each input, set its Default property to the corresponding column:
    ThisItem.Manhours
     
    5. Use the OnChange property of each input to update the collection. Example for Manhours:
    Patch(TableData, ThisItem, { Manhours: TextInput_Manhours.Text })

    6. Add a submit button. In its OnSelect property, use this code to save the table data and other form fields into the SharePoint list:
    Patch(
        SharePointListName,
        Defaults(SharePointListName),
        {
            OtherField: OtherFormInput.Text,
            TableDataColumn: JSON(TableData)
        }
    )
    7. If you need to load existing data from SharePoint into the table when editing, use this code in the screen's OnVisible property:
    ClearCollect(TableData, JSON(ParseJSON(SelectedSharePointItem.TableDataColumn)))
     
    This process dynamically binds the gallery, allows user input, and saves the data in a single row in SharePoint as a JSON string.

    If this helps kindly mark the answer as verified.
  • CU25110323-1 Profile Picture
    CU25110323-1 6 on at
    Table / Selection
    Also, I am open to creating a new list if I need to, to capture the data correctly

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,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard