Legacy Dev Forum Posts

 View Only

Sign Up

Load all forms by GetQualityForms()

  • 1.  Load all forms by GetQualityForms()

    Posted 06-05-2025 18:05

    simon | 2018-01-29 06:27:57 UTC | #1

    var formq = new QualityApi(); var formmaps = new Dictionary<string, string>(); var formResponse = formq.GetQualityForms(); if(formResponse.Entities != null) { foreach(var form in formResponse.Entities) { if (!formmaps.ContainsKey(form.Id)) { formmaps.Add(form.Id, form.Name); } } }

    ....... var query = new AggregationQuery(); var q = new QualityApi();

    query.Interval = start.AddHours(-24).RoundDown(new TimeSpan(1, 0, 0)).ToString("yyyy-MM-ddTHH:mm:ss") + "/" + end.RoundUp(new TimeSpan(1, 0, 0)).ToString("yyyy-MM-ddTHH:mm:ss"); query.Granularity = "PT1H"; query.GroupBy = new List<AggregationQuery.GroupByEnum> { AggregationQuery.GroupByEnum.Userid, AggregationQuery.GroupByEnum.Queueid, AggregationQuery.GroupByEnum.Formid, AggregationQuery.GroupByEnum.Conversationid };

    var api = new AnalyticsApi(); var evaluationAggregateresults =api.PostAnalyticsEvaluationsAggregatesQuery(query); ........

    above are some code , i use GetQualityForms() to get all forms,and saved into variable named formmap; and use AnalyticsApi.PostAnalyticsEvaluationsAggregatesQuery and group by formid to load data ,data returned with formid,but these formid not exists in the form collection formmap .

    <img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/e702ad027675fc3a1c537185cee40805146f6412.png" width="690" height="343">

    could anyone help me ?


    tim.smith | 2018-01-29 18:31:38 UTC | #2

    Are those possibly forms that were used in the past and you have since deleted from the list of forms? What happens if you try to retrieve the form by ID (GET /api/v2/quality/forms/{formId})?


    simon | 2018-01-30 00:33:16 UTC | #3

    i am sure the form not been deleted,because i can get form by id(GET /api/v2/quality/forms/{formId}) also use (GET /api/v2/quality/forms/{formId}) is not a good idea, you know api.PostAnalyticsEvaluationsAggregatesQuery maybe return a huge amount of data,so when we foreach these data ,if we cant save all forms into variable then we need to search form by (GET /api/v2/quality/forms/{formId}) during loop,it will degrade performance


    tim.smith | 2018-01-30 17:50:19 UTC | #4

    Check your paging when getting the list of forms. That API is a paged resource, so it may be that you're just not getting all of the pages. If that's not the case, I'd open a support ticket for this as it sounds like it's a data issue where the back end service isn't returning correct results.


    simon | 2018-01-31 01:07:08 UTC | #5

    <img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/9c26a47f0abe57b67ea80a001af3b96e8ba06e8f.PNG" width="690" height="284">

    var formq = new QualityApi(); var formsResponse = formq.GetQualityForms(); no parameter is passed in ,so pageSize default value is 25,pageNumber default value is 1 i only got 5 records,so it is nothing to do with paging i think

    thx


    system | 2018-03-03 01:12:33 UTC | #6

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 2419