No undefined variables have been added to Variable list

NateBI
NateBI Contributor
edited January 21 in Workflows

Hi All,

How do we dynamically add people to a group using variables returned from a query?

This error comes up often, it's not super clear what it means but I've gathered it's when an action requires a fixed input. Same for "Email a Person" or "Shard a Card"

Tagged:

Best Answers

  • DanHendriksen
    DanHendriksen Domo Employee
    Answer ✓

    You would map the output from the "New Users" step a variable, and you would then pass that variable in here.

    So go to the "New Users" step, on the output select "Create Variable and Map". If you setup your step correctly, it should create a list of variables that is a person. You can then pass that in as an input to this function.

    If you haven't done so yet, I'd encourage you check out the "Getting Started with Workflows" training at learndomo.domo.com. It goes into detail on how inputs and outputs work, and how you pass data through variables like this.

  • NateBI
    NateBI Contributor
    edited February 6 Answer ✓

    Quick summary of the less intuittive aspects well-explained by Dan:

    Data types are configurable in the SQL Query per column

    This is how you assert for a "person" (see user id)

    The current row object then becomes it's own module so when you select take action see below this then accepts the currentrow.variable rather than result.variable

    You can reference different versions of the same workflow, which allows for breaking the workflow down into multiple parts particularly useful for User actions that may require a user's response:

    CAVEAT: This means, after deployment, if you need to edit a sequenced step you'll have to create and deploy a new version of every step prior and re-link them within the StartWork function which is a pain (correct me if I'm wrong @DanHendriksen)

    @DanHendriksen I've not done this justice so feel free to add anything but also this would be a huge gap-filler as a walk-through on the workflows playlist (Youtube). Thanks for the help!

Answers

  • DanHendriksen
    DanHendriksen Domo Employee

    @NateBI - sorry you're having an. issue.

    In the query field, on the right hand side, define your output as persons. FYI - a person is a user ID. So if your query were something like "SELECT USER_ID FROM DATA", then the output will be a list of strings. Change the output type to a list of persons using the menu on the right.

    In the Domo Groups package, there is an "Add People To Group", that takes a list of persons/people as an input, as well as the group.

  • NateBI
    NateBI Contributor

    Hi @DanHendriksen , thanks but not sure where this output is?

  • DanHendriksen
    DanHendriksen Domo Employee
    Answer ✓

    You would map the output from the "New Users" step a variable, and you would then pass that variable in here.

    So go to the "New Users" step, on the output select "Create Variable and Map". If you setup your step correctly, it should create a list of variables that is a person. You can then pass that in as an input to this function.

    If you haven't done so yet, I'd encourage you check out the "Getting Started with Workflows" training at learndomo.domo.com. It goes into detail on how inputs and outputs work, and how you pass data through variables like this.

  • NateBI
    NateBI Contributor
    edited February 3

    Hi @DanHendriksen ,
    Yep this is already the case:

    However, when I select the custom to insert this variable it doesn't give me the option to select the variable:

    I thought the issue here may be that you've said "a list of variables" i.e data type = list whereas this has text (ABC). However, the same applies for the "Loop Over Dataset" template which returns a list of the first row:

    In this case the Query with SQL does not return a result object of the dataset with each field as a variable.

    The documentation is pretty confusing, The core flow of inputs to outputs seems to change based on the action/code function chosen.

  • DanHendriksen
    DanHendriksen Domo Employee

    You have a list of objects and you need a list of persons. Send me a DM and we can setup a call where I can show you.

  • DanHendriksen
    DanHendriksen Domo Employee

    @NateBI - glad you got this up and running. If you have any thoughts/notes to share with the community that would be awesome.

  • NateBI
    NateBI Contributor
    edited February 6 Answer ✓

    Quick summary of the less intuittive aspects well-explained by Dan:

    Data types are configurable in the SQL Query per column

    This is how you assert for a "person" (see user id)

    The current row object then becomes it's own module so when you select take action see below this then accepts the currentrow.variable rather than result.variable

    You can reference different versions of the same workflow, which allows for breaking the workflow down into multiple parts particularly useful for User actions that may require a user's response:

    CAVEAT: This means, after deployment, if you need to edit a sequenced step you'll have to create and deploy a new version of every step prior and re-link them within the StartWork function which is a pain (correct me if I'm wrong @DanHendriksen)

    @DanHendriksen I've not done this justice so feel free to add anything but also this would be a huge gap-filler as a walk-through on the workflows playlist (Youtube). Thanks for the help!

  • DanHendriksen
    DanHendriksen Domo Employee

    Nate, thank you! Can you clarify the video you think would be helpful? Happy to get it made.

    And yes - when you version workflows that start workflows it has a cascading effect. You always start with the last one, get it deployed and then work your way back. We have plans to make this easier down the road.

  • NateBI
    NateBI Contributor
    edited February 6

    Great news @DanHendriksen.

    In summary the video could touch on identifying the data structure returned, and identifying the data type required.

    For example, the SQL query function returns optional outputs a list or rows and then for each feature it could be TEXT, INT, PERSON etc.

    The conditional input requires the list object. for the calculation (see image)

    The send email function requires a Person - which must be a user_id (not an email for example)


    It's the type of detail I miss when say I've re-written the query and have to link all the variables again. Say on an IDE it would be obvious since they'd grey out or underline in red, but these are hidden in the pannels so you have to know that "Yes" requires that variable 'Result' in this case.

    Another example is breaking the object into child properties for the "currentRow" object 😅 I'm remembering them as I rebuild this!