Crow Canyon Software Forum

Forum Navigation
Please or Register to create posts and topics.

Workflow - Build string action

I would like to see an action that allows you to build a string using placeholders and then assign that to a variable. For example:

{WebUrl}/_api/someMethod("[ColumnName|InternalName]")

Hi Michael,

Please define a variable in NITRO Workflow and then use strcat function to concate the string.

Ex: $strcat({WebUrl},/_api/someMethod,(",[ColumnName|InternalName],"),)

Quote from supportTeam on August 18, 2021, 9:15 am

Hi Michael,

Please define a variable in NITRO Workflow and then use strcat function to concate the string.

Ex: $strcat({WebUrl},/_api/someMethod,(",[ColumnName|InternalName],"),)

"Close but nocigar"

First, the {WebUrl} function isn't giving me anything. So I hard coded the web URL into the string along with several column references. here's what the debugging shows:

Function Name: strcat
Function Parameters: http://webserver/NITRO/_api/web/getfilebyserverrelativeurl("/NITRO/ApprovedInvoices/,[Name|FileLeafRef],")/moveto(newurl="/NITRO/Invoices/,[FolderName|FolderName],/,[Name|FileLeafRef]," ,flags=1)
Expression value type: Invalid
Expression value type: Invalid Field Value Type: Invalid
varURI - Exception in ProcessVariable for variable with Id: 3 , Error: GetExpressionComputedValue: Invalid argument for computed condition value: http://webserver/NITRO/_api/web/getfilebyserverrelativeurl("/NITRO/ApprovedInvoices/

 

Ok, I have this working on everything EXCEPT parenthesis (). I can put in the HTML code for left and right parenthesis in the variable and when I email myself the resulting string, it's translated properly. However, when I try to use it in the Call Web Service action, it still sees the HTML code (( and )) instead of ( and ). Is there any kind of escape character we can use to let Nitro know to use the actual character and not think it's part of a function? How about something like **( to tell it to use that character?

"Programming is nothing but smoke and mirrors..."

I was able to get this working with a bit of trickery. On the library I created two new columns, left and right. Both are setup as single line text fields with a text limit of 1 and a default value of either ( or ) depending on the column. Both columns are also required. Then I referenced those columns in my $strcat() function and used that as the URI in a Call Web Service action. Much to my surprise, IT WORKED!

James Restivo has reacted to this post.
James Restivo

That is good to hear. Shows that with the right effort, just about anything can be accomplished. Your solution is a trick worth remembering!