How can u create folder inside the selected path in powerapps gallery to a sharepoint library using Powerapps? - sharepoint

I have a gallery wherein the data source is connected Documents in sharepoint library. I already create flow that triggered the creation of folder in /Shared Documents path, however want I want after that creation of folder I need to create another folder inside it or another folder inside the folder that I have created.
Can someone help me with this matter. Thank you in advance

The quickest way to achieve this, is to extend your existing flow with another step that uses the path of the new folder to add a child folder (from the outputs of the action creating it). This, however is not very flexible.
How to create subfolders with Power Automate
Alternatively, you can use the Respond to PowerApps action to feed back the path of the new folder to Power Apps. Then you can use the result to trigger the same flow again, with different inputs as many times as you want.
Responding to Power Apps from Power Automate
Yet another option is to create this functionality in a solution. This enables you to call your folder-creating flow as a child flow. Then you could create an arbitrary number of parent flows, e.g. one flow calling it from the app, then another flow could fire when the folder is created to add a child folder, etc.
How to create a parent-child flow relationship
You can also look into the SharePoint REST API reference to see if there are any useful additional options when creating folders/subfolders.

Related

Excel Script + Power Automate - Script not found. It may have been unshared or deleted

I have a PowerApp that:
takes a SharePoint file,
filters the data,
and calls a PowerApps/Flow to:
execute an Excel script,
get the file contents,
and create a file with it.
The script is shared to all PowerApps users, same for the source file, everyone can read, edit and delete the file.
When anyone but I run the flow either from the PowerApp or from the flow itself, they get an error "Script not found. It may have been unshared or deleted." This happens when anyone other than me tries to run the app/flow.
The weird thing is that if I run the PowerApps / Flow, everything works fine.
Do you know how can I get other users than me to run it either from the PowerApps or PowerAutomate ?
This issue is 'kinda' similar to this one but it's different in the source file.
Found out how this one is working. Sharing the solution here :
Firstly, you'll need to create all your flows and PowerApps apps within a "Solution". You can create a new solution from "Solutions/New solution".
Within this new solution, create a button-triggered flow that runs Office Scripts. Let's call it "Child flow". Please note this flow requires to have a last action to respond to a PowerApp or flow.
Configure this child flow with run-only users settings as described in my previous response. Make sure to choose "Use this connection ...".
Within the same solution, create another flow with the PowerApps trigger. This flow will be triggered by your PowerApps app. In this flow, add a step to run the child flow you've just created above.
Within the same solution, create your PowerApps app. Configure your PowerApps button to run the second flow (the parent flow).
Now share the PowerApps app with another user, ask them to try it out, and see if the Run script action in the child flow can work properly.
Thanks to Yutao from MS for the solution !

Best way to use an excel template in a .NET application?

I built a simple vb.NET Windows Application using Visual Studio, in which it collects data, opens an excel template and places the data on a worksheet before renaming and saving a copy of the file to a specified location.
My intention is to send this application to a few people to use, who are not connected by any network. I was thinking of having a text field which automatically assumes the newly created workbook will be saved to the user's documents directory and will allow the user to update this path if they wish before collecting any data.
For the template, I want a pretty robust method that ensures the template can be found. I will put a check for finding the template when the application initially runs, but it would be great if I could embed this template in the application, so that when I send the application to a new user, I only have to send one .exe application. Is this possible? The other method I was thinking was to have the template in the same directory as the application and instructing the user to ensure this is the case. The check that then searches for the template will allow the user to point to where the template actually is if it cannot find it in the same directory as the application.
At the moment, I open and rename the template using the following method
Dim newLocation As String = <I create a string for the new path and name>
fso.CopyFile(Source:=<Current template path>, Destination:=newLocation)
If embedding an excel workbook can be done I would love to know how (e.g. add an existing item, set the build action to 'Embedded Resource' and then...?) , or alternatively if placing the template in the same directory as the application is the most suitable option I would like to hear thoughts as well.
Thank you
You don't need to make vb.NET Windows Application using Visual Studio - use for such
application Excel. Just make Excel file with protected cells - in which you have to
write formulas and personal data for every user - which must stay unchangeable and cells for data, which user have to enter every time. This is more quick and easy

One time javascript function run in custom action

I have a request from the customer that they want every time they create a subsite (publishing site) .We have to add a custom column to OOTB Documents list.
I have done some researching the way to add the custom column to
Documents list in onet.xml but have no luck .
Then i think about the work around solution that i create a
ScriptBlock custom action that will call javascript function which
will add the custom column to document list , then i will put this
custom action to a feature ,and finally i will reference that feature
in onet.xml.
It run well but the javascript function call every time i refresh the page. I just want it run one time when i active the feature.
Does anyone have any suggestion ? I use sandbox solution and Sharepoint Online .Sorry for my bad English
I don't think a custom action is the right way to do this, Custom actions generally need some sort of user interaction.
Get CKS dev tools in Visual studio
Create a new SharePoint solution
Add a new web template(CKS Dev) to your solution from the Add new item menu in VS
Create an additional feature (web) with a list template (Your documents Library and add your column)
Update the Web templates onet file
Also sometimes it's better to put up what your having issues with as you have said you have had no luck with the above, What is the issue you are having, Post some code up etc rather than going down the route of changing the way you implement the solution
Many Thanks
Truez

comparing sharepoint list and sqlserver table

I have a list in sharepoint which maintains particular month OnCall list,and we are maintaining employee directory in sql server. My requirement is to get complete data from sql server and show it in sharepoint and compare with sharepoint list and show small icon for the employees who are On Call for that particular Month. Can anyone please suggest me the waus of implementing this.
Thanks in advance.
Update: I have finished the part where I have to connect to the sqlserver database and get the employees information. For this we are using 3rd party web part to connect to the sql server and pull the data from the table. Now I have to show some kind of image on the employee name to show that he is on-call for that week. We are going to cretae custom list for maintaing the list of people who are on-Call. Can anyone please advise me on how to accomplish this.
Write a custom webpart which will pull the data from the list using sharepoint object model and SQL server using ADO.NET and do the said comparison.
If you were looking for out of the box, I am afraid there i too little information given here to analyze if its feasible out of the box or not.
If you have the SharePoint Enterprise version, you can look at using the Business Data Catalog. This will let you bind columns to external data sources. This might provide you with the functionality you're looking for.
If you do not have the Enterprise features, do you have access to deploy WSP packages and custom code?
You will have to write your own data access to your external data source. Your options would be to have a job that pulls data from the external data source and populates SharePoint list(s) or create a custom view that pulls the external data on-demand.
You'll have to come up with synchronization strategies. Meaning, is the data in the external SQL data source static, reference information that does not need to be updated depending on what a user does in SharePoint? This seems to be the case based on your question. If you do need to update the external data source, you'll have to hook into the on save event (so probably a custom event handler that listens for ItemAdding) to update the data, validate, and optionally cancel the operation with an error message.
If you can't deploy WSP packages / DLLs, you could take a look at the jQuery SharePoint library. This will let you interact with lists using jQuery. If you also write a WCF or Web Service wrapper around the data you need access to from your external data source that is accessible from the SharePoint environment, you can use hack together a solution.
To accomplish this you'd need to place a Content Editor Web Part on the page you need custom data access. In there you will write the code to reference the jQuery javascript library and jQuery SharePoint library. The code will have to make the calls to your external data service and make any updates you need.
This is the least reliable method to accomplish what you want since it's entirely page-based and can be broken by simply disabling script or someone editing the CEWP or removing it altogether.
If you don't have access to place a CEWP or any of the other solutions, then you have no options at all.
it relatively easy now to pull all the data using the third party webpart and saving it into a custom list. I would recommend you not only creating custom list but also creating the content types for this list. take a look at SharPoint MVP's post about creating a Custom List with Content Types

How to create folders base on external datasource in SharePoint 2010?

My goal is to extend functionality of the current asset tracking system.
Basically I would like to pull list of Clients and related assets from external system into sharepoint 2010.
Then I would like to associate documents with each asset. My first intention is to create a list of folders where each folder would be named respectively.
Tell me, if I am going in the wrong direction.
You can open your document library in explorer view and easly copy your content from external sorce to document liabrary, as windows explorer.
You can reffer the below link for more details
http://msmvps.com/blogs/shane/archive/2006/01/12/80843.aspx

Resources