I am trying to understand how to pass 2 seperate parameters ( email addresses for example ) from a powerapps button to a flow. I have seen how to use Compose in Flow to "Ouput" all emails to the one Output, but I need 2 seperate variables that I can use in my flow to create a file and run a powershell script.
For Example:
I need to run a Set-MailboxPermission -identity User1 -Owner Mgr1
I need seperate variables for User1 and Mgr1 to be passed from PowerApps and how I would write that in Flow
I understand the concept of
PowerApps Button,Compose,CreateFile ( pshell command in here ), Send Email -- But this only allows 1 output to be passed using "Compose"
1) How would I write this in PowerApps
2) How would I write this in Flow
Thanks in advance!
Steve
Solved! Go to Solution.
Hello Stevo,
If I understand you correctly, create a flow and use PowerApps as a trigger. Initialize a variable and give it a meaningful name as this is what you will be asked for in PowerApps as an argument.
In the value, tell it to 'ask in PowerApps'.
When this flow is called from PowerApps, it will ask you to pass the parameters.
I take it you want to pass two or more items with a flow. Not sure where you are storing the data, but when I do this in sharepoint I use the ForAll() function. It means there is a seperate Flow for each one
Anyone know how this could be done? is this a combination of "Split" and "variable" expressions inside of flow?
Hello Stevo,
If I understand you correctly, create a flow and use PowerApps as a trigger. Initialize a variable and give it a meaningful name as this is what you will be asked for in PowerApps as an argument.
In the value, tell it to 'ask in PowerApps'.
When this flow is called from PowerApps, it will ask you to pass the parameters.
Hey dawidvh , thanks for the reply! I had figured it out using compose --> input and asking in powerapps ( I was over thinking it with expressions). I like your idea for using "Initialize Variable" more though, thank you for that.
So now I can pass 2 parameters ( or more ) directly from my powerapp to the flow which will create a ps1 and run the script.
In case anyone is looking to get something similiar to this done, there was a post on it by SergeLuca I believe. It all comes down to the flow:
PowerApps Button-->Initialize Variable-->Initialize Variable1-->
Create File ( Location: OnPrem Data Gateway, Name: pshell.ps1, content: Set-AdPermission -Identity 'Initialize Variable' -owner Initialize Variable1) --> Email out status--> Generate a log or whatever you like.
The key to do this is creating that watcher script on a server that watches for ps1 files created in a specific share ( the onprem gateway locaion). This would be a constant pshell window open with a keep alive script. Once pshell.ps1 is created it sees the file, then it does an invoke-expression on the ps1 whch runs the command. This can also be done with scheduled Tasks, works great!!
Thanks again dawidvh!
Stevo
I am having problems doing this similarly but to a Flow for an HTTP web service. I created 3 variables with Initialize variable which connect to parameters from text input in the PowerApp. But when I create a button in the PowerApp to call the flow, it just says Run, and does not show to enter the 3 parameters. Why is that?
Hi,
Can you please tell me that How to add "testforstevo" function ?
User | Count |
---|---|
260 | |
110 | |
89 | |
52 | |
44 |