You can add this in the Page_Load function in code behind:
//Create GraphQL query
string url = System.Configuration.ConfigurationManager.AppSettings["ApplicationUrl"] +
"/graphql?query={ request(number:"+CURRENT_REQUEST.Text+"){ dataset(filter:{names:[\"FILE_ID1\",\"FILE_ID2\"]}){ items{ name fileValue{ url } } } } }";
//Send HTTP request to retrieve JSON result
System.Net.HttpWebRequest requestGraphQL = (System.Net.HttpWebRequest) System.Net.WebRequest.Create(url);
requestGraphQL.Credentials = new System.Net.NetworkCredential(APIUsername, APIPassword);
System.Net.HttpWebResponse response = (System.Net.HttpWebResponse) requestGraphQL.GetResponse();
System.IO.Stream receiveStream = response.GetResponseStream();
System.IO.StreamReader readStream = new System.IO.StreamReader(receiveStream, Encoding.UTF8);
//Convert JSON result to a dynamic JSON object
dynamic obj = Newtonsoft.Json.JsonConvert.DeserializeObject(readStream.ReadToEnd());
//Clear GridView each time to avoid duplicates
this.FormData.Tables["SectionID_GridViewID"].Rows.Clear();
//Autofill GridView with URL value of all files
foreach(var item in data.request.dataset.items){
//Put validations to check if the url value is not null or empty
System.Data.DataRow newRow = this.FormData.Tables["SectionID_GridViewID"].NewRow();
newRow["SectionID_GridViewID_Field1"] = "1";
newRow["SectionID_GridViewID_Field2"] = "2";
//This is where we add the URL in the GridView
newRow["SectionID_GridViewID_Field3"] = "<a href=\"" item.fileValue.url + "\" target=\"_blank\">View File<a>";
this.FormData.Tables["SectionID_GridViewID"].Rows.Add(newRow);
}
// Accept Changes in the Form Data
this.FormData.Tables["SectionID_GridViewID"].AcceptChanges();
SaveFormData(this.FormData);
BindFormDataToFields(this.FormData);