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 / Fetch and display Shar...
Power Apps
Unanswered

Fetch and display SharePoint list items on PowerApps.

(0) ShareShare
ReportReport
Posted on by 219

Hi,

I am using SharePoint list with PowerApps for the field service engineers(users) who install/repair the Air conditioners. On the entry screen, there will be two buttons "Existing Records" and "New Record". If user selects "New Record" it will navigate to new form where user submits and its gets stored in SharePoint list. This is working fine.

 

I would like to know how can I show existing records based on current logged in user i.e, when user clicks on "Existing Records" on entry screen, they will navigate to all existing items of current user where Status column is not equal to "Closed". And when they select specific item(right arrow icon on each item) it should navigate to details of that item in read only mode. There needs to be a edit icon on the top and when user clicks it, they should be able to edit the form and submit the changes. 

 

I am a beginner and need help firstly with how to show existing records and then specific item details when user clicks the right icon arrow. Help me on this please. 

 

 

@CNT @RandyHayes @WarrenBelz @Pstork1 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @SumanthDundi7 ,

    Fairly broad question without any existing code or values supplied. Firstly there are potential Delegation issues with the Created by field, but as this is time-based, the below will work on the Items of a Gallery

    With(
     {
     wItems:
     Sort(
     YourListName,
     ID,
     Descending
     )
     },
     Filter(
     wItems,
     'Created by'.Email = User().Email &&
     Status <> "Closed"
     )
    )

    On The OnSelect of the gallery

    Set(gblID,ThisItem.ID);
    Navigate(YourFormScreen)

    The Item of the Form would be

    LookUp(
     YourListName,
     ID=gblID
    )

    and the FormMode of the Form would be

    FormMode.View

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

  • SumanthDundi7 Profile Picture
    219 on at

    Hi @WarrenBelz , Thank you so much for the help. It is working.

    Can you please help me understand my questions here:

    1. I am using a custom people picker field to filter the items instead of Created by. Will this overcome the issue you mentioned with delegation? Infact, I would like to know what is that delegation issue you have mentioned using Created By field.

    2. It is working like charm using With function, but would like to know if this filtering is possible also just using Filter and Sort functions? If so can you please help me how to achieve it?

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @SumanthDundi7 ,

    Please firstly have a read of my blog on Delegation - you might also be interested in another one on Data Structure.

    A Person field is also not Delegable, so that will not solve the issue - you are far better using the Office365Users connector in Power Apps and writing what you want to save into Text field/s.

    Created by is simply not Delegable - however if you write this as above in addition to a Text field, then that field will be Delegable for queries.

    The With() function simply "pre-collects" (in the case) the newest 2,000 (or whatever your limit is) records and presents the result in what is essentially a (very) temporary collection, which is not subject to Delegation warnings as you are not querying SharePoint any more.

    I always use With() for these circumstances and it gets rid of the warning - you could do this

    Filter(
     Sort(
     YourListName,
     ID,
     Descending
     ), 
     'Created by'.Email = User().Email &&
     Status <> "Closed"
    )

    and it will actually return the same result, but you will get a Delegation warning on it.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • SumanthDundi7 Profile Picture
    219 on at

    Thank you @WarrenBelz for letting me know. Happy to know that you actually owns a PowerApps related website. That helps folks like me. 

  • Hd008 Profile Picture
    19 on at

    Hi WarrenBelz,

     

    I tried accessing my sharepoint list using the below mentioned formula but the gallery is not able to access the items from the list. The formula works on the items of the gallery. Do I need to set something else for the gallery to retreive items from the list. The formula is shown below:

     

    SortByColumns(
     Filter(
     'Desk Reservations',
     'Reserved By'.Email = currentUser.Email && 'Check Out From Number' >= Value(
     Text(
     Today(),
     "yyyymmddhmm"
     )
     )
     ),
     "CheckOutFromNumber",
     SortOrder.Descending
    )

     

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @Hd008 ,

    Try

    Value(
     Text(
     Today(),
     "yyyymmddhmm"
     )
    )
  • Hd008 Profile Picture
    19 on at

    HI WarrenBelz,

    Thanks for the response.

    I already tried using the code snippet that you posted, but the problem persists.

    The app is able to send data (patch) into a SharePoint list, but it is not able to fetch that data from that same list.

    Is there any other way to fetch data from a sharepoint list into a power app?

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @Hd008 ,

    I can only suggest getting rid of that number format and simply storing the value as a Date/Time field.

  • Hd008 Profile Picture
    19 on at

    Hi @WarrenBelz, Thanks for the suggestion. There was a different issue regarding the fetching of details from the SharePoint list. I corrected it and now it works fine.

  • kazowks Profile Picture
    2 on at

    Hello, 

    That's can't work for my app, I have this code and I want to show all items from my list.
    Sort(
    If(
    FiltreDemande.Value = true;
    Filter(
    Tickets;
    Or(
    TicketDemandeur = UserNom.Text;
    TicketDestinataire = UserNom.Text
    );
    TicketStatut = SelStatut.Selected.ValeurTexte
    );
    If(
    FiltreTicketCat.Value = false;
    Filter(
    Tickets;
    TicketStatut = SelStatut.Selected.ValeurTexte
    );
    Filter(
    Tickets;
    TicketStatut = SelStatut.Selected.ValeurTexte;
    TicketCategorie = TicketCat.Selected.ValeurTexte
    )
    )
    );
    TicketDate;
    SortOrder.Descending
    )


    I can't edit the code, I should just write to have the all of items. 
    Can you help me for that ? 
    Thanks.

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
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard