How to give SharePoint Online Site URL Dynamically in NWC

  • 14 June 2022
  • 4 replies
  • 313 views

Hi Team,

I am developing workflows in NWC and we have many actions related creating list item, update item and query list etc. Each time Site URL is hardcoded under SharePoint Site URL. Is there a way we can save the URL in a variable and refer that variable wherever is needed.

Or is there a way to get site URL from context. Please suggest the best practice.

Thanks!


4 replies

Userlevel 6
Badge +16

Hi @Krishna521 


 


Here's my idea


 


1. Save the URL in a SharePoint List


[Title] | [Type] | URL


App1 | Dev | www0


App1 | Prod | www1 


 


2. Query the List - Where Title=App1, Type=Prod


 


3. Save the result to a variable


varURL = "www1"


 


Hope that helps

Thanks for the response. Even to query the sharepoint list, we need provide site url. Is that correct?
Userlevel 6
Badge +16

Consider this SharePoint List as the single source of truth in your team or organization.


 


If you wish, you could set up another resource to replace the SharePoint list as the single source of truth e.g. a Web Service, a SQL Database, an Excel file, a Word document, a XML file or a plain Text file. Then store the list of URLs into that resource. 


 


1. Save the URLs in your desired resource


2. Query the resource - Where Title=App1, Type=Prod


3. Save the result to a variable


 

Userlevel 6
Badge +16

Hi @Krishna521, Upon further research and exploring...


You can get the SPO Site URL. Refer to the image below



 

Reply