public static async Task ReplyWithTable(IDialogContext context, string workbookId, Table table) { try { var range = await ServicesHelper.ExcelService.GetTableRangeAsync( workbookId, table.Id, ExcelHelper.GetSessionIdForRead(context)); await ServicesHelper.LogExcelServiceResponse(context); var reply = $"**{table.Name}**\n\n{NamedItemsWorker.GetRangeReply(range)}"; await context.PostAsync(reply); } catch (Exception ex) { await context.PostAsync($"Sorry, something went wrong getting the **{table.Name}** table ({ex.Message})"); } }
public static async Task ReplyWithTable(IDialogContext context, string workbookId, WorkbookTable table) { try { var headers = ServicesHelper.GetWorkbookSessionHeader( ExcelHelper.GetSessionIdForRead(context)); var rangeRequest = ServicesHelper.GraphClient.Me.Drive.Items[workbookId] .Workbook.Tables[table.Id].Range().Request(headers); var range = await rangeRequest.GetAsync(); await ServicesHelper.LogGraphServiceRequest(context, rangeRequest); var reply = $"**{table.Name}**\n\n{NamedItemsWorker.GetRangeReplyAsTable(range)}"; await context.PostAsync(reply); } catch (Exception ex) { await context.PostAsync($"Sorry, something went wrong getting the **{table.Name}** table ({ex.Message})"); } }