Integrations > Podio Workflow Auotmation

Running ProcScript from PWA

App Builder & Automation Expert

Stay Updated with ProcFu!

Subscribe to our newsletter for the latest tips, updates, and automation insights.

Subscribe Now

Here's how to use ProcScript with Podio Workflows:

  • Writing Your Script: First, create your script in ProcFu and save it with a specific name.
  • Using Payloads: You can access any data you’re sending to the script with the payload variable.
  • Returning Values: Use the return command to send a value back to your workflow.
  • Running Your Script in PWA: To execute your script from Podio Workflow Automation (PWA), use the call_procscript command. This lets you run your script and receive a value in return.
  • Remember, Podio needs the results as text. So, if your script returns objects or arrays, they will be automatically turned into JSON text.

Naming Your Script

  • When you run code through an automation, there's no way to give it a specific name. To make it easier to identify in your ProcFu statistics, it's a good idea to start your code with a comment that acts as a name or description. For example:
  • // Calculate something
    x = [(Variable) foo]
    // the rest of your code follows...
    
  • While naming your code isn't mandatory, not having a descriptive comment at the beginning will lead your ProcFu stats to identify your code by the first few keywords it contains. This could make your stats confusing, especially if your code includes a PWA token, leading to each run being counted as a separate "object" in your stats.

Handling Long Scripts

  • Be aware that if your scripts take longer than 30 seconds to run, Podio Workflow Automation (PWA) will disconnect, causing an error due to the timeout.
  • To avoid this issue, you should use call_procscript_bg.This command runs your script in the background, but it doesn't directly return any values.
  • Therefore, you'll need to find a way for your script to signal when it's done and to share any results. A common approach is to activate a PWA flow with pwa_trigger_flow_on_item to indicate completion and return any necessary values.

RAW code (DEPRECATED)

You also have the option to directly write your code within Podio Workflow Automation (PWA).

Here's how you can do it:

  • Place your script in a Remote POST action within PWA. Feel free to include any tokens needed, and the code's RETURN statement will fill the specified PWA variable.
  • Create a new automation step, choose "ProcFu Function", and then input your script.
  • For an enhanced experience, use the EDIT button to access the full Editor & Debugger.

Keep in mind, tokens from PWA are used exactly as they are provided. This means if your script expects a string, ensure to encase the token in quotes and decode it using urldecode. For example:

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

Always use the RETURN command to send back a value, such as RETURN "true" or RETURN x, etc.

Remember, Citrix Podio Automation expects all results in text form. Thus, any objects or arrays returned by your code will be automatically converted into JSON format.

Flow Examples: Traditional Vs ProcScript

What better way to show ProcScript superiority than by examples?

Getting a list of comment ID's

πŸ‘Ž The Traditional Way

πŸ‘ The ProcScript Way

Get a setting from a Var

πŸ‘Ž The Traditional Way

πŸ‘ The ProcScript Way

Running a MySQL Query

πŸ‘Ž The Traditional Way

πŸ‘ The ProcScript Way

Love using ProcFu Guide?

Share your testimonial and let us know how ProcFu has helped you.

Share Your Testimonial

Built with ❀️ by Thaha for the Community