web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help with visualizing ...
Power Apps
Answered

Help with visualizing form?

(0) ShareShare
ReportReport
Posted on by 364

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:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    on at

    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,

  • EpicTriffid Profile Picture
    364 on at

    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?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 408

#2
WarrenBelz Profile Picture

WarrenBelz 382 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 328 Super User 2025 Season 2

Last 30 days Overall leaderboard