I'm building a settings component and I want to be able to reuse the component for other apps(obviously the purpose of a component). However, I want to be able to allow the user to save the settings from this component so the next time they load the app the settings load as well. since this data source could be used to hold settings for multiple apps I'm thinking that the app id might be the right piece of data to use as a key to determine which settings should be loaded into the component when an app loads. Is there a way to get and record this app id? Or is there possibly a better/easier piece of data to use?
Then theoretically you would just need to keep track of the AppID and the style in a SP list. Then have the app check that list in OnStart for the theme. You would just do a Lookup on the AppID to your list.
Thanks. I'm not too concerned about the user info since this component is really only for the administrator/designer. My primary concern is that when the app loads it loads the correct 'theme' for the app. Those values would be retrieved from a data source and that data source would need to have record of which app which styles get applied too.
If you want to automate the process, you would need to build the automation. You would probably need to set up a table in Sharepoint that would hold an ID for the user, an App Identifier and the data you need to capture and retrieve. You would have to set a variable in the OnStart to hold the app identifier - you could use the AppID, but you would need to manually add that to each app you want to have this functionality. Then you would need to capture the User info. That is available either from the User function or the 365 connector. Then you could use that info to populate the Sharepoint list along with the other data you need to capture.
@schuess3 I'm not familiar with those methods. I was simply thinking that the component would leverage a form and the user would save on submit.
@BrianS I know you can get the ID from there but how would you retrieve it in the app. It would need to be some type of automated process so the user of the app can just plug n play the component and have it save with the app id.
If you are planning on using SaveData and LoadData, to cache the settings, I don't believe this is possible as those files are encrypted and not accessible by other apps. In case you were headed that way.
"The device's built in app sandbox facilities are used to isolate saved data from other apps." -src
matt
The app ID would be a unique identifier, so that should work. If you click the three dots next to the app name in the list of Powerapps you can select "Details' - the app ID is listed there
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional