-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
GetSubmissions cannot filter by formIDs due to a formatting bug.
When CreateConditions formats the filter, it always puts quotes around the values. The correct format is:
{"formIDs":["your-form-id","your-form-id#2"]}
ref: https://api.jotform.com/docs/#user-submissions
to filter by multiple form IDs. The c# API adds extra quotes resulting in:
{"formIDs":"["your-form-id","your-form-id#2"]"}
Can be fixed with:
`private NameValueCollection CreateConditions(int offset, int limit, Dictionary<String, String> filter, String orderBy)
{
NameValueCollection parameters = new NameValueCollection();
if (offset != 0)
parameters.Add("offset", offset.ToString());
if (limit != 0)
parameters.Add("limit", limit.ToString());
if (filter != null)
{
String value = "{";
int count = 0;
foreach (KeyValuePair<String, String> pair in filter)
{
**if (pair.Key == "formIDs")
{
value = value + "\"" + pair.Key + "\":" + pair.Value;
}
else
{
value = value + "\"" + pair.Key + "\":\"" + pair.Value + "\"";
}**
count++;
if (count < filter.Count)
value = value + ",";
}
value = value + "}";
Console.WriteLine(value);
parameters.Add("filter", value);
}
if (orderBy != null)
parameters.Add("orderby", orderBy);
return parameters;
}`
Not sure if there are other filters that can have multiple values, but they probably suffer the same issue.
Metadata
Metadata
Assignees
Labels
No labels