Flow Designer - Generate Encoded Query limitation

Tim Deniston
Mega Sage
Mega Sage

I am working on an Azure DevOps Boards integration using the Azure DevOps Boards Spoke. This has actions "Create Work Item" and "Update Work Item". Those actions have an input that uses the Dynamic Template type. This should accept an encoded query string, typically provided by the Utility Action Spoke's Generate Encoded Query action. The Generate Encoded Query action has a limitation, though, of only allowing 20 key:value pairs.

 

To get around this limitation, I have historically used two Generate Encoded Query actions and then concatenated them via script in the Additional Fields input on the Create Work Item and Update Work Item actions. As of Xanadu, this no longer appears to work. Instead, I constantly get a "Dynamic Action error" in Workflow Studio. The only way to get rid of the error is to pass in one of the encoded query action outputs. 

 

Is there a way to get the old functionality back so I can pass in the encoded query via string or expand the 20 key:value pair limitation? I really only need 25 values (which is a ton, I know, but it's what's needed). Is there some other workaround or configuration change I can make to work with this? 

1 REPLY 1

Wizard
Tera Contributor

I have also encountered the same issue with Generate Encoded Query in the flow designer, however for this i have created another action by using the same logic present in the OOTB Generate Encoded Query action and included additional fields and edited the script for that.

script i used inside the new action

(function execute(inputs, outputs) {
try {
var nameValues,nameValues2;
var nvalues = inputs.nameValues;
var nvalues2 = inputs.nameValues2;
try {
nameValues = JSON.parse(nvalues);
nameValues2 = JSON.parse(nvalues2);
} catch (e) {
nameValues = JSON.parse(nvalues.replace(/\\"/g, '"'));
nameValues2 = JSON.parse(nvalues2.replace(/\\"/g, '"'));
}
var keys = Object.keys(nameValues);
var encodedQuery = "";
for (var i = 0; i < keys.length - 1; i++) {
encodedQuery += keys[i] + "=" + nameValues[keys[i]] + "^";
}
encodedQuery += keys[i] + "=" + nameValues[keys[i]] + "^";

var keys2 = Object.keys(nameValues2);
for (var i = 0; i < keys2.length - 1; i++) {
encodedQuery += keys2[i] + "=" + nameValues2[keys2[i]] + "^";
}
encodedQuery += keys2[i] + "=" + nameValues2[keys2[i]];
outputs.encoded_query = encodedQuery;
outputs.status = "Success";
} catch (e) {
outputs.status = "Error";
outputs.error_message = "Invalid Inputs";
}
})(inputs, outputs);