Skip to main content

Notifications

Community site session details

Community site session details

Session Id : wPhi4PvM+fdqbYykmqZeoe
Power Automate - Power Automate Desktop
Answered

Variable Concatenation

Like (0) ShareShare
ReportReport
Posted on 5 Dec 2023 10:06:48 by 167

Hello everyone,

 

I am running an extraction that stores independent values in variables name 'LinkCMVMConsulta0', 'LinkCMVMConsulta1', and so on up to 'LinkCMVMConsulta4'.

 

That extraction is working as intended the problem is that I want to access each one inside a For each action and I already have a variable named 'Counter' starting at '0' and incrementing with each iteration of the loop.

 

Since all my variables start with 'LinkCMVMConsulta' and then have a number in front of them changing I was thinking of appending the 'Counter' to the text 'LinkCMVMConsulta' and use it as a variable, not as a string, and I have not been able to do so.

 

I tried writing %LinkCMVMConsulta%%Counter% inside the Set variable action but it gives me an error saying that %LinkCMVMConsulta% doesn't exist which is true, so I don't know what to do .

 

If anyone knows any way to help I would really appreciate it.

Thanks in advance,

 

Telmo Ferreira

  • TelmoERF96 Profile Picture
    167 on 05 Dec 2023 at 13:45:10
    Re: Variable Concatenation

    Thank you for your time @UshaJyothi20 that works.

     

    Was thinking I could achieve the same result with less actions but it's the result I wanted so thank you once again for all the help.

  • Verified answer
    UshaJyothiKasibhotla Profile Picture
    6 Super User 2025 Season 1 on 05 Dec 2023 at 12:17:06
    Re: Variable Concatenation

    Do one thing you can crate list of that variables or you can write them in an excel and you can loop through them

    then you can write 

    %currentitem+counter%

     

    Hope this helps

  • TelmoERF96 Profile Picture
    167 on 05 Dec 2023 at 12:04:05
    Re: Variable Concatenation

    @UshaJyothi20 

     

    I know that is the correct way the variable should be written, that is why I wanted to write it like this LinkCMVMConsulta + Counter. So it would automatically change the variable to the correct one for each iteration of the loop I'm running. Without a way to write the variable dynamically I guess I will have to use a bunch of If and Else to get the correct output I want

  • UshaJyothiKasibhotla Profile Picture
    6 Super User 2025 Season 1 on 05 Dec 2023 at 11:46:29
    Re: Variable Concatenation

    youe variables are named as LinkCMVMConsulta0

    and LinkCMVMConsulta1

     

    so you need to use the same variable from the select or give the same name

    like

    %LinkCMVMConsulta0+Counter%

    %LinkCMVMConsulta1+Counter%

     

    Hope this helps

    Usha

     

  • TelmoERF96 Profile Picture
    167 on 05 Dec 2023 at 11:36:32
    Re: Variable Concatenation

    Sure @UshaJyothi20 

     

    The 'LinkCMVMConsulta' variables have URLs stored as text value

    TelmoERF96_0-1701775901595.png

    TelmoERF96_1-1701775924750.png

     

    And the 'Counter' variable that has a numerical value

    TelmoERF96_2-1701776046428.png

     

    When I tried what you proposed the action gave me error without even running the code saying variable 'LinkCMVMConsulta' doesn't exist, which in fact doesn't.

     

    TelmoERF96_3-1701776146090.png

     

  • UshaJyothiKasibhotla Profile Picture
    6 Super User 2025 Season 1 on 05 Dec 2023 at 11:11:54
    Re: Variable Concatenation

    can you please share some screenshots?

    and which type of data is there in the variables

     

  • TelmoERF96 Profile Picture
    167 on 05 Dec 2023 at 11:05:24
    Re: Variable Concatenation

    Thank you for your response @UshaJyothi20 

     

    But that still doesn't work, I still get the error 'variable "LinkCMVMConsulta" doesn't exist.

  • UshaJyothiKasibhotla Profile Picture
    6 Super User 2025 Season 1 on 05 Dec 2023 at 10:42:51
    Re: Variable Concatenation

    if you need to concatenate then try this 

    %LinkCMVMConsulta+Counter%

     

    Hope this helps

    Usha

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,695 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started