I have a flow that syncs data from a data source to a SharePoint list. After getting the information from the data source, the flow does the following:
Therefore, my flow has 3 separate SharePoint actions that all call the same list.
I plan to copy and reuse this flow to sync data to different SP lists. (This flow cannot be turned into a public template for various reasons, including that it uses a custom connector.)
I would like to "parameterize" the SharePoint list information at the top of my flow, store the SharePoint site and list information at the beginning and then use that information to automatically populate this information in the 3 SharePoint actions. (I realize that additional configuration will be required to set the value of each column in the SharePoint list in the Create Item and Update Item actions, but anything I can do to simplify the configuration of the flow would be helpful.) However, this does not seem to be possible.
(In contrast, I could create an Email variable at the top of my flow and use that variable to populate the To field of an Outlook Send Email action.)
Is there any way to achieve this?
Solved! Go to Solution.
Hello @msalamonjl ,
you can do that by using variables for the 'Site Address' and the 'List Name'. Initialize the variables at the beginning, you'll update them for each flow. Then you can use these variables in the other actions. The only complication will come with the item create/update actions. If you use variables for the 'Site Address' and 'List Name' the flow will not be able to load the specific columns for that list = you can't use the 'Create item' and 'Update item' actions directly. You'll have to use HTTP requests for the operations. You can check the older threads to see how to create the HTTP requests:
Create item: https://powerusers.microsoft.com/t5/Building-Flows/use-flow-to-update-various-sharepoint-group-sites...
Update item: https://powerusers.microsoft.com/t5/Building-Flows/Update-mutliple-fields-for-item-using-REST-api/td...
Hello @msalamonjl ,
you can do that by using variables for the 'Site Address' and the 'List Name'. Initialize the variables at the beginning, you'll update them for each flow. Then you can use these variables in the other actions. The only complication will come with the item create/update actions. If you use variables for the 'Site Address' and 'List Name' the flow will not be able to load the specific columns for that list = you can't use the 'Create item' and 'Update item' actions directly. You'll have to use HTTP requests for the operations. You can check the older threads to see how to create the HTTP requests:
Create item: https://powerusers.microsoft.com/t5/Building-Flows/use-flow-to-update-various-sharepoint-group-sites...
Update item: https://powerusers.microsoft.com/t5/Building-Flows/Update-mutliple-fields-for-item-using-REST-api/td...
Tom, I think that approach will work. Obviously it would be nice if the create and update item actions could be more dynamic.
Btw, the solution requires the HTTP action and constructing the body with the correct information. it would be much easier to construct the body using a text editor instead of needing to insert expressions for every column value. (There are over 25 columns.) Do you know if there is a way to construct the body to include variables and outputs in a text editor?
Hello @msalamonjl ,
what do you mean by expressions for every column value? Every dynamic content has code on the background, so you can use a dynamic content in some action and then select/copy/paste it into a text editor if that helps. Below is an example from SharePoint 'Date' column that's output of 'Apply to each 2' action. If you paste the code including the opening @{ and closing } into some PA action it'll be translated as dynamic content in the flow.
User | Count |
---|---|
88 | |
37 | |
26 | |
13 | |
13 |
User | Count |
---|---|
123 | |
54 | |
37 | |
24 | |
21 |