web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Variable Concatenation
Power Automate
Answered

Variable Concatenation

(0) ShareShare
ReportReport
Posted on by 170

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

I have the same question (0)
  • UshaJyothiKasibhotla Profile Picture
    203 Moderator on at

    if you need to concatenate then try this 

    %LinkCMVMConsulta+Counter%

     

    Hope this helps

    Usha

  • TelmoERF96 Profile Picture
    170 on at

    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
    203 Moderator on at

    can you please share some screenshots?

    and which type of data is there in the variables

     

  • TelmoERF96 Profile Picture
    170 on at

    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
    203 Moderator on at

    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
    170 on at

    @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

  • Verified answer
    UshaJyothiKasibhotla Profile Picture
    203 Moderator on at

    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
    170 on at

    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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard