What could cause a Variable to NOT appear on a dynamic content list in Power Automate?

Options

Not sure if I missed something or flow placement - this is what I have, but the Variable doesn't appear as an output option:

7665ca0641ba9fa3ee1f1f6e36729838-huge-im

Tagged:

Comments

  • Alex Wong
    Alex Wong ✭✭✭✭✭
    Ninth Anniversary Facilitator 4 Name Dropper Photogenic

    @Reuben Schmitz
    variable doesn't appear as an output option where?

    Some variable doesn't show in dynamic content due to the variable's data type not what flow think you should put at certain input field. So the question is what action input you are trying to access the array variable for what reason?

  • @Alex Wong I am looking to include specific custom fields to a word merge document in the flow - odd that I was able to do this in a previous document and the steps of the flow look the same.


  • Alex Wong
    Alex Wong ✭✭✭✭✭
    Ninth Anniversary Facilitator 4 Name Dropper Photogenic

    @Reuben Schmitz
    Your array variable is a “complex” array, meaning it is an array of “objects”, not a simple array (i.e. String array ["abc", “abcd”, “abcde”] or integer array [1, 2, 3, 4])

    “inserting” a complex array to a “input field” to populate in word document is not going to look what you want it to look. it will just show [{"Category":"category name","Value": “attr value”},{"Category":"category name","Value": “attr value”}] directly in the word document that you are populating, which is not likely what you want to do.

    You need to decide what exactly you want to populate into the field. Is there possible to have more than one? if more than one, how do you want to show it? did you actually mean to show the custom field (attribute) category too, or just the value?

    Once you decide how you want to populate the input fields, then we can determine how you want to use “Select” and/or join() expression to populate into your word doc.

  • @Alex Wong I believe the output will work -as I said, I patterned this after a flow that also displays multiple Custom Fields in a Word doc. But still not sure why the Variable doesn't appear on the Dynamic content list.

  • Alex Wong
    Alex Wong ✭✭✭✭✭
    Ninth Anniversary Facilitator 4 Name Dropper Photogenic

    @Reuben Schmitz
    dynamic content not showing up is as I mention, data type.

    to “avoid” this issue, use a “Compose” action and put the variable in the compose, then Ctrl-A to select the variable, Ctrl-C to copy it. Then go to your word doc populate action and Ctrl-V to paste it.

    or, you can go to Expression and type this in: variables('Name of Variable')

  • @Reuben Schmitz- Hi Reuben, I thought I would reply to say sometimes when you get too deep into the flow and you have a lot of loops like Apply to Each, the variable can get “lost”.

    As Alex said, if you put the Variable into a Compose action in a step before the word doc, you can still use the variable. The Compose will remind the flow the variable is there and available to use. Then pull in the Outputs of the compose into your merge. I have also had to do this when pulling in a variable into an Email body.

    Good luck, let us know if that works.

  • @Carol Grant
    It did work, but it didn't bring along the formatting of the data that I had in the “Append to Array” variable for the Custom Fields. Still looking at that. Any thoughts as to the best way for format the Custom Fields into more of a table-like view?

  • @Carol Grant
    Does it work to add the “Append to Array” variable after the compose?

  • @Reuben Schmitz- Hi Reuben- that is an issue with the Compose, you do lose the formatting. You have to do the formatting again (formatnumber, formatdatetime). Now I see you would lose your table formatting also. I have put my Compose outputs into a Select then you can convert that to a table.

    Can you move the Append to array somewhere else in the flow? I think you can't access it because it might be embedded in another loop which might be disconnected from the rest of the flow. I've realized that if you can keep them all under one main “apply to each” it will recognize all the pieces.


  • @Carol Grant thanks for the input - I have tried a couple of ways to connect the formatting but to no avail. I think I will bring it to the next user group for the group's thoughts on this. I must be missing something here.

  • Alex Wong
    Alex Wong ✭✭✭✭✭
    Ninth Anniversary Facilitator 4 Name Dropper Photogenic

    @Reuben Schmitz
    We can debug this for you next Tuesday's user group, however, in the meantime, you might want to check my previous replies where I pointed out my concern of complex array. Simply trying to add a complex array into populate word input field is not going to format it correctly.

    So questoin is, what is your expectation of the result, is it meant to be a “table” of multiple columns for each custom fields (category column and value column?) or are you simply trying to add the multiple values (i..e Value 1, Value 2, Value 3)

Categories