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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Offline app - Sharepoi...
Power Apps
Answered

Offline app - Sharepoint lookup

(0) ShareShare
ReportReport
Posted on by 97

Hi

I'm currently working on an offline app.  Idea is that the user will be online in the office to pull down data then be offline while they are out and about using the app, then online again when back in the office to upload the data to SharePoint.  

 

I'm fine with the second part, holding the data in a collection until the app is "online" again to upload.

 

My question is that I have a couple of drop downs linked to SharePoint lists.  Can someone advise when the app is initially online in the office how I can pull down the SharePoint list data locally to then work in offline mode?  And can I filter the data I pull down locally as I will never need the full list? 

 

Many thanks

Categories:
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @sanderson82 ,

    Which Type column (from your SP List) does the Dropdown list box connect to? Choice Type Columns?

    Do you want to pull down Dropdown box available options locally, then use it within the Dropdown box when the app is Offline?

     

    Based on the needs that you mentioned, I think the collection could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

    Set the OnStart property of App to following:

    ClearCollect(Dropdown1Options, Choices('SP List'.ChoiceField1));
    ClearCollect(Dropdown2Options, Choices('SP List'.ChoiceField2));
    ClearCollect(Dropdown3Options, Choices('SP List'.ChoiceField3));

    Set the Items property of the Dropdown1 to following:

    If(
     Connection.Connected,
     Choices('SP List'.ChoiceField1),
     Dropdown1Options
    )

    Set the Items property of the Dropdown2 to following:

    If(
     Connection.Connected,
     Choices('SP List'.ChoiceField2),
     Dropdown2Options
    )

    Set the Items property of the Dropdown3 to following:

    If(
     Connection.Connected,
     Choices('SP List'.ChoiceField3),
     Dropdown3Options
    )

    ...

    ...

    Please consider take a try with above solution, then re-load your app, then check if the issue is solved.

     

    Best regards,

  • sanderson82 Profile Picture
    97 on at

    @v-xida-msft  thanks for your reply.  My 2 drop downs are combo boxes with the following Items set

     

    I_Contract - Sort(Filter('Contract Manager', Status = "In Progress", Include = "Y"),CNumber,Descending)

     

    Value = Contract

     

    I_Unit - Sort(Filter('Unit Register', Contract = I_Contract.Selected.Contract), UnitID, Ascending)

     

    Value = Unit_ID

     

    How would I adapt your code if not using choices?

     

    Also, in relation to using collections, once the app is offline would the collections remain? i.e if the app was completely closed down and then re-opened in offline mode?  Would LoadData() and SaveData() come in to play in relation to pulling down the initial SP list data for the dropdowns? I've been trying to read and understand these 2 functions for offline

     

    Many thanks for your help

  • sanderson82 Profile Picture
    97 on at

    Just a quick update, I have attempted the following code which seems to work but I'm not sure this would be best practice...

     

    OnStart

    If(
     Connection.Connected,
     ClearCollect(DropdownContracts, Filter('Contract Manager', Status = "In Progress", Include = "Y")),
     LoadData(DropdownContracts, "DDContracts",true)
    );
    SaveData(DropdownContracts, "DDContracts");
    If(
     Connection.Connected,
     ClearCollect(DropdownUnits, 'Unit Register'),
     LoadData(DropdownUnits, "DDUnits")
    );
    SaveData(DropdownUnits, "DDUnits")

     

    Dropdown 1 Items 

    Sort(DropdownContracts, CNumber, Descending)

     

    Dropdown 2 Items

    Sort(Filter(DropdownUnits, Contract = I_Contract.Selected.Contract), UnitID, Ascending)

     

     

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @sanderson82 ,

    Please consider Type the following formula within the OnStart property of App control:

    ClearCollect(ContractColelction, Sort(Filter('Contract Manager', Status = "In Progress", Include = "Y"),CNumber,Descending));
    ClearCollect(UnitCollection, Sort(Filter('Unit Register', Contract = I_Contract.Selected.Contract), UnitID, Ascending))

     

    The collection would be destroyed when you close your canvas app (close current session). If you want the saved collection data to remain even though you re-open your app, I think the SaveData function and LoadData function could achieve your needs. You could use the SaveData function to save your collection data into local device. Then when you re-open your app, use the LoadData function to load the cached collection data from your local device.

     

    Please check and see if the following blog would help in your scenario:

    https://powerapps.microsoft.com/en-us/blog/build-offline-apps-with-new-powerapps-capabilities/

     

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard