ProcFu Help
Search
🧩

Running ProcScript from Podio Workflows

Create your script in ProcFu and save it with a name.

Use the payload variable to access any payload you’re passing.

Use return to return a value to your flow.

Eg:

Then from PWA, use call_procscript to run your code and get a return value, eg:

Note that Citrix Podio Automation requires results as text, so any objects or arrays that your code returns will be JSON encoded.

Naming your Code

Since there is no concept of a name when passing code from an automation, it is best to have the first line of your code as a comment to be able to differentiate it in your ProcFu stats later. Eg:

// Calculate something
x = [(Variable) foo]
// rest of code ...

It is technically not required to name your code, but in the absence of the first line comment, your stats in ProcFu will use keywords from the start of the code, which will be confusing and if there's a GlobiFlow token there, each execution will create a new stats "object".

The Chrome extension will enforce the first line comment for you.

Long Running Code

Note that for long running scripts (longer than 30 seconds), PWA will hang up the connection after 30 seconds and you’ll get an error.

To get around this, you need to use call_procscript_bg which will launch your script in the background. This will not return any values.

Your script would therefore need to do something to announce it’s completion and return values at the end. Usually we recommend triggering a PWA flow using pwa_trigger_flow_on_item

RAW code (DEPRECATED)

Alternatively, you can write your code directly in PWA.

Simply place your code into a Remote POST action. You can insert any tokens you wish, and the RETURN from the code will populate the GlobiFlow variable you specified.

Add a new automation step and select "ProcFu Function":

and add your code:

Even better, click on the EDIT button and access the full BASIC Editor & Debugger:

Please note that token values are inserted by GlobiFlow as-is. In other words, if you're expecting a string in your code, you'd need to put the token in quotes and urldecode it. For example:

numeric = [(Item) Podio Item ID]
string = urldecode("[(Item Title]")

If you expect a return value, always make sure you use the RETURN command. Eg:

RETURN "true" or RETURN x etc

Note that Citrix Podio Automation requires results as text, so any objects or arrays that your code returns will be JSON encoded.

(c) 2024 ProcFu for Podio - by Globi | Join the Discussion in our Podio Workspace.