cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
samsundar
Regular Visitor

Multiple variable initialization in single block

Is there way to initialize Multiple variable in single block ?

currently i am using initialize variable block for each variable declaration ? when i have more 10 variables its congested.

instead of code flow its more of variable flow 😞

any workaround for this ? also not able to find documentation for this.kindly help.

 

 

 

 

 

4 REPLIES 4
ScottShearer
Super User
Super User

@samsundar 

Doing what you want would require a loop and you can't declare a variable inside of a loop.  Consider using Compose actions in place of your variables where possible - many times Compose actions can replace a variable and are much more efficient.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hi @samsundar ,

 

You can use Parse Json action to define multiple variables . I just declared this object :

Content : 

{
"fromEmail": "abc@abc.com",
"replyToEmail": "abc@abc.com",
"libraryId": 1,
"messageId": 2
}

 

 

Schema : 

 

{
    "type""object",
    "properties": {
        "fromEmail": {
            "type""string"
        },
        "replyToEmail": {
            "type""string"
        },
        "libraryId": {
            "type""integer"
        },
        "messageId": {
            "type""integer"
        }
    }
}
 
I am able to use it further 
 
thanks

@ManishJain does this solution works for changing/dynamic values as well ? i dont have fixed values for variables some of changes based on output response from mail.

when i tried this unable set variables.

This is a great solution !

Thank you very much.

 

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Users online (3,699)