Discussions

 View Only
  • 1.  (Pipelines) Get Users in Role / Process XML from HTTP API

    Posted 08-29-2022 11:31
    Hello, any help/advice would be much appreciated.

    I'm trying to send a reminder email to users in a specific Role, in a specific App, using Pipelines.

    As far as I can tell, there is not a JSON RESTful API call that does this (Get Users only returns all users for an App, with no info on Roles).  However, API_UserRoles returns each user from an app with what Roles they have.  In theory, I could somehow loop over this and send the email to only those users with a specific role.

    I can successfully use the Quickbase Channel -> 'Quickbase APIs' -> 'Make Request' step to call API_UserRoles and get this data.

    Here's where I run into trouble:
    • How do I process this XML into a form that another step could use (e.g. loop over it and send emails)?  I found this question: "To capture an XML response from an API in Pipelines" but I can't seem to figure out how get {{a.json.qdbapi.value}}.  When I try to view its contents (emailed to myself) it is blank.
      • There isn't any "Result" field or something like that from this request step available in subsequent steps.  Only URL, Method, Headers, Content Type, & Body.
    • For instance, if I want to get the JSON out of the XML (using {{a.json.qdbapi.value}}) with the JSON Handler Channel -> 'Iterate over JSON Records', the 'JSON Source' field states 'No json sources in the pipeline'

    Thank you for any help you can offer,
    ~Daniel

    ------------------------------
    Daniel
    ------------------------------


  • 2.  RE: (Pipelines) Get Users in Role / Process XML from HTTP API

    Posted 08-31-2022 13:48
    You can use the Regex channel to create a list of objects to iterate:


    Then you can add a loop to check each one.  Since each "group_0" in the match is a string representation of an object, you can reference any of it's properties.  For example, to get the id, convert the string to an object then reference the property: {{ (b.group_0|from_json)['@id'] }}

    If you want to filter out certain roles just put the filtering logic in the jinja for step B to exclude adding to the list.

    Hope that's helpful! ​

    ------------------------------
    Doug Henning
    ------------------------------