Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Help with visualizing form?

(0) ShareShare
ReportReport
Posted on by 345

Hi there,

 

Im currently creating an app that allows academics to enter units they teach on. For each unit, there can be multiple delivery styles (lectures, tutorials etc) that can be applied to a single unit. So, for example, you can have "Unit 1", and that unit can include lectures, tutorials and workshops.  how I'm currently making it work:

 

Capture-LI

What my current app requires, however, if for someone to add the same unit multiple times for each delivery style. On the backend, this works great for me because it means my data is easy to sort when I export it from the SP list where it's stored. But for the user, I feel it makes it quite clunky. 

 

It would be great to make it so that you can add one unit, with multiple delivery styles before you press submit, but it would appear in the sharepoint list in a way that means I can still work with it.

 

If anyone has any ideas, I would really appreciate it. Hopefully I've explained it properly. An idea of how i would like it to work is below:

 

 

Capture1
Thanks!

 

Matt

Categories:
  • EpicTriffid Profile Picture
    345 on at
    Re: Help with visualizing form?

    Thankyou for that! That's exactly what I'm looking for! If the Sharepoint list that I'm using later gets replaced with a database, will the patch still work?

  • Verified answer
    v-xida-msft Profile Picture
    on at
    Re: Help with visualizing form?

    HI @EpicTriffid ,

    Could you please share a bit more about your scenario?

    Do you want to add one unit with multiple delivery styles before you press submit button to submit it to your SP list?

     

    If you want to add one unit with multiple delivery styles before you press submit button to submit it to your SP list, I think the combination of Collection, ForAll function and Patch function could achieve your needs.

     

    On your side, you could save the Units records from your SP list into a Collection when you load your app, then use the Collection as data source within your Gallery. When you add new Unit record via pressing a "+" button, you need to add record into this Collection firstly. When you press the "Submit" button, patch all new records within your Gallery into your SP list together.

     

    I have made a test on my side, please take a try with the following workaround:

    Set the OnStart property of the App control to following:

    ClearCollect(LocalUnitRecords, 'YourSPList')

    set the Items property of the Gallery to following:

    LocalUnitRecords

    Add a "+" button along side the "Submit" button, set the OnSelect property of the "+" icon to following:

    Patch(
     LocalUnitRecords,
     Defaults(LocalUnitRecords),
     {
     UnitName: UnitNameTextBox.Text,
     UnitSize: UnitSzieDropdownBox.Selected.Value,
     DeliveryStyle: DeliveryStyleDropdownBox.Selected.Value,
     Hours: HoursTextBox.Text,
     ...
     }
    )

    Set the OnSelect property of the "Submit" button to following:

    ForAll(
     RenameColumns(Gallery1.AllItems, "UnitName", "UnitName1", "DeliveryStyle", "DeliveryStyle1"),
     If(
     IsBlank(LookUp('YourSPList', UnitName = UnitName1 && DeliveryStyle = DeliveryStyle1)),
     Patch(
     'YourSPList',
     Defaults('YourSPList'),
     {
     UnitName: GalleryUnitNameBox.Text,
     DeliveryStyle: GalleryDeliveryStyleBox.Selected.Value,
     ...
     }
     )
     )
    );
    Refresh('YourSPList');
    ClearCollect(LocalUnitRecords, 'YourSPList')

    Note: The GalleryUnitNameBox, GalleryDeliveryStyleBox, ... represents the Text Input box, Dropdown box, ... within the Gallery (Gallery1). The Gallery1 represents the Gallery in your app.

     

    More details about the ForAll function and Patch function, please check the following article:

    ForAll function

    Patch function

     

    Best regards,

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,522 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,890 Most Valuable Professional

Leaderboard