629 Views
2 minute read
Categories
Power Apps

Showing Repeating Section Data from SharePoint List in Power Apps

This is just a small addendum to my previous article . Once you have created a repeating section in PowerApps and saved it in a SharePoint list, I am going to show you one easy step to retrieve those data from the SharePoint list and make them available in edit and view form.

I am sure you already have created the repeating section in your form. If you haven’t yet, please refer to my earlier blog.

Now consider the following lines of code in the OnEdit and OnView property of SharePointIntegration of the form.

Set (RepSecCOllString, LookUp( 'Repeating Section Test', ID=SharePointIntegration.SelectedListItemID, 'Repeating Section Data')); Clear (CollRepSec);
Set (EditRepSecStr,LookUp( 'Repeating Section Test', ID=SharePointIntegration.SelectedListItemID , 'Repeating Section Data'));Set(EditRepSecStr,Left(EditRepSecStr,Len(EditRepSecStr) - 1));
ForAll (  
    Split (  
        EditRepSecStr,  
        "|"  
    ),  
    Collect (  
        CollRepSec,  
        {  
            SrNo: Text (Last (FirstN(Split(Result,";").Result,1).Result).Result),
            Type: Text (Last (FirstN(Split(Result,";").Result,2).Result).Result),
            Description: Text (Last (FirstN(Split(Result,";").Result,3).Result).Result) 
        }  
    )  
)
Showing Repeating Section Data from SharePoint List in Power Apps

Finally, when you open your SharePoint form in edit and view mode you will be able to see your data like this.

Showing Repeating Section Data from SharePoint List in Power Apps

This concludes the demonstration of how easily you can make use of repeating sections perhaps even to create an editable grid. PowerApps do not yet provide a straight forward grid control and this is one of the ways to get to a workaround. I thought tables are pretty important controls to use!

Let me know what you think of it.

Baishakhi Adhikary

About Baishakhi Adhikary

Baishakhi is currently working as an Associate Software Engineer with a demonstrated history of working in the information technology and services industry. She has extensive knowledge in Python, C#, Microsoft SharePoint, and Microsoft PowerApps.

LinkedinTwitterFacebook

8 replies on “Showing Repeating Section Data from SharePoint List in Power Apps”

I have text box, people picker (combobox), dropdown controls in the gallery (repeating table) and followed your steps. working for text box and multiline text but not for people picker.
How to assign email address to people picker control in Power apps gallery? As you mentioned, I able to split text but not working for people picker like below code
AssingedTo:Text (Last (FirstN(Split(Result,”;”).Result,5).Result).Result)
Please can you help on this?

Set (RepSecCOllString, LookUp( ‘Repeating Section Test’, ID=SharePointIntegration.SelectedListItemID, ‘Repeating Section Data’)); Clear (CollRepSec);
In the above code, what is mean ‘Repeating Section Test’. Is it List name? or Repeating section column name in the list? Please can you help me to understand this line.

I added this in a button to load the gallery with some data, it addes three gallery items with null values in the text box

Set(ProjectAmountDescriptionsgal,”245;adding 245;| 265;adding 265;|”);

ForAll(
Split(
ProjectAmountDescriptionsgal,
“|”
),
Collect(
Spendingcoll,
{
ColAmount: Text(
Last(
FirstN(
Split(
Result,
“;”
).Result,
1
).Result
).Result
),
ColAmountDesc: Text(
Last(
FirstN(
Split(
Result,
“;”
).Result,
1
).Result
).Result
)
}
)
);

Leave a Reply

Your email address will not be published. Required fields are marked *




Enter Captcha Here :