Hi.
My Scenario is:
I have an HTML-Template that I want to use within my PowerApp.
The PowerApp then shall replace placeholders within the HTML and store that "filled out" HTML Template to SharePoint.
I now want to store the initial HTML-Template within SharePoint so that e.g. users can update the HTML-Template in SharePoint and the PowerApp pulls the new template without needing to update the App itself.
My question:
How can I read the HTML-file content from SharePoint with PowerApps?
What I have done:
- Create a DataSource Connection to target SharePoint library
- Fetch Document with LookUp-Function.
--> Okay, now I have got the file Properties, but do not know how to access the file content and store it in a local variable or field.
Any idea how I can achieve this?
I'm thankful for any help - :-).
Manuel
Solved! Go to Solution.
Hi @Manuel_P :
I've made a test for your reference:
1\MY library:
2\Add a gallery and set it's items property to
library3
to show all files in this gallery
3\Create a flow:
4\insert the flow into the app
5\set the arrow's Onselect property to:
Set(TheHTMLText,Bof0203.Run(ThisItem.'Full Path').htmltext)
When the user clicks on this arrow, the HTML text of the current record will be stored in the variable 'TheHTMLText'
6\Add a HTMLtext control and set it's HtmlText property to:
TheHTMLText
Best Regards,
Bof
Hi @Manuel_P :
I've made a test for your reference:
1\MY library:
2\Add a gallery and set it's items property to
library3
to show all files in this gallery
3\Create a flow:
4\insert the flow into the app
5\set the arrow's Onselect property to:
Set(TheHTMLText,Bof0203.Run(ThisItem.'Full Path').htmltext)
When the user clicks on this arrow, the HTML text of the current record will be stored in the variable 'TheHTMLText'
6\Add a HTMLtext control and set it's HtmlText property to:
TheHTMLText
Best Regards,
Bof
Hi @v-bofeng-msft,
Thank you for your respond.
I guess that works.
But is it really the intention to start an "asynchronous" workflow to fetch data from a data source?
For me as a classic developer this does not feel right.
I rather would prefer a get-call/webservice call or so.
I know this is a basic question of how to fetch data in software development but isn't there some other way of doing this?
Are there good arguments of why to do it with a workflow rather than: "it's the only workaround available for this scenario"?
Looking forward to your reply.
Best regards.
Manuel
Hi @Manuel_P :
In fact, I can't tell you that's the only workaround ,but using flow is the most convenient way I can think of right now, because the actions in flow are actually encapsulated APIs, which are usually very stable and easy to use.
If you want to implement it by calling web service, you need to find a related SharePoint API (this is beyond the scope of this forum), and create a custom connector to call this API (the API can not be called directly in the Canvas app, you need to call a API by creating a custom connector).
Best Regards,
Bof
I am currently attempting to use this flow to display the contents of HTML files in my Documents Library from SharePoint, however I am having issues.
To start, I have two files in my Library at the moment as seen below.
Here is the flow I have:
In the OnSelect option for the gallery, I am putting this formula in with no luck.
What I would like it to do it set the file contents of the file selected in the gallery, and also navigate to Screen2 where the HTML text box is located and display the contents of the selected HTML file on Screen2. Thanks in advance for your help.