cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fernandosilva
Continued Contributor
Continued Contributor

Append to String Variable Not Working

Hi all,

 

I'm building a flow coming from an action in Power Virtual Agent that get the data of the customer and display on the chatbot.

The first block is the "Get Row" where I connect to the database, table name and row.

 

Until that point is fine, so after that I use the "Initialize variable" to store the data and the "Append to string variable".

The latest is not working as the dropdown is blank and I cannot place a name manually. When I click on the arrow down, nothing comes up and I can't fill up the "Name" field.

 

See screenshot below:

2022-01-17 14.48.43 emea.flow.microsoft.com b9b5113e31f9.png

 

Any help with that would be great.

 

Also, after that step, how do I get the data from the variable and show it on the chatbot from Power Virtual Agent?

 

That will also be a great help if someone can do it.

 

Kind regards,

 

Fernando

13 REPLIES 13
Pstork1
Multi Super User
Multi Super User

Can you show a screenshot of the Initialize Variable action for the variable you are trying to reference?  Also a screenshot showing where it is in the flow in relationship to the append action.



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

HI @Pstork1 ,

 

See screenshot below.

2022-01-17 15.14.47 emea.flow.microsoft.com 0890d2deaad8_LI.jpg

 

The Append to string variable is faulty as I can't write a name manually, but also when pressing the arrow-down, it's all blank.

 

 

If you need more info, please let me know.

 

I know these Microsoft tools are quite new and I'm a newbie, so Microsoft tutorials are not fully helpful.

 

Any help would be great.

The problem is you initialize the variable as an array but want to append to a string.  Either change the initialize to a string variable or use the append to array action.  Do you want the variable to be an array or a string when you are done?



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

Hi @Pstork1 ,

 

The final data would a string, so I changed to string.

Now, on the "Append string to variable" dropdown, the name of the variable created above is showing up. Is that the name that I need? I don't know as the value is the same of the name.

 

2022-01-17 15.41.52 emea.flow.microsoft.com 1fa88bc317a6.png

Quite frustrating. 

You pick the name of the variable you want to append to in the dropdown.  The value should be whatever value it is that you want to append.  Right now you are trying to append an empty string variable to itself, so I doubt that is what you want.  I assume what you want is to append some value from the SQL rows that you retrieved.



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

Hi @Pstork1 ,

 

I managed to get it right.

Now, when I'm on the chatbot and i want to display a message with the value of the variable, the chat keeps in a loop. I guess that is another subject... 😕 ....frustration....

That's the point the data is not passing through:

2022-01-17 16.45.12 emea.flow.microsoft.com 843f258b7c1c.png

 

No idea why is not passing through.

As a troubleshooting measure, try adding a compose that contains the value you are appending to the string variable right before you append it inside the loop.  Then after a run you'll be able to see what the actual value was that was being appended to the string.

 

Also, your original screenshot shows a Return value to PVA action, but there is no data in it.  Make sure you add the variable to that or it won't return anything.  When you get back to the bot you can display the returned value in a message.



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

Hi @Pstork1 ,

 

I have done it all.

Can't get my head around these blocks.

I could easily do the same process with gulp and an Ajax call to the server, but as I need to connect to PVA, this is my only way to do it and I can't get the value to show on PVA or even the flow to work properly.

Microsoft tutorials are not really helpful and they seemed to think everyone is a developer and knows all the languages, which is why they advertise the PVA for non developers...lol

 

As soon as I make one value to pass through PVA, I'm happy, so I can make all the data I need to pass through.

 

This is my latest set up.

 

2022-01-18 10.10.28 emea.flow.microsoft.com 43a66abbb28d.png

I had meant to put the Compose inside the same Apply to Each loop as the Append to String, but your current setup should also work.  When you look at a previous run how many loops are the Apply to each making?  What values are you seeing in the Compose loop?  What does the string being returned to PVA contain?  What issue are you having?

 

I'll be happy to help, but your setup looks like it should work.



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

Hi @Pstork1 ,

 

What I'm trying to achieve:

 

I'm creating a flow from Power Virtual Agent for a Insurance company and when the customer place their policy number I want to retrieve the Policy from the sql database with the following details:

Policy Number

Full name

Email

Phone number

Package (insurance package)

 

After retrieve the data from the sql server, I want to display on the chat bot.

 

I know that if I can retrieve one single data, the other ones are gonna be easier.

 

As I'm new to Power Automate, I'm struggling to pass a single data for now hehe.

So when you look at a previous run of the flow what are you seeing as values in the Compose statements in the Apply to each loop?  Is it showing Policy numbers?  And are they being appended to the string variable?



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

@Pstork1 

 

Hi there, I managed to make it work initializing the variable before the server request, adding the compose block and the parse jason block before adding to a string variable and returning that variable to PVA. 

 

I works better with HTTP as I'm doing an api call.

 

Thank you for all your support.

 

2022-01-24 09.16.13 emea.flow.microsoft.com c42448e8a74d.png

Helpful resources

Announcements

Are you ready to SUIT UP and become a Super User? Find out how TODAY!

We can’t imagine our communities without the amazing work of our Super Users! They are the most active members of our community, offering incredible solutions, providing answers to questions across the forum, and working closely with the Microsoft Power Platform Community team to find new ways to engage our communities around the world.   If you are interested in becoming a Super User, today at #MPPC23, we annoucned a new way for you to “SUIT” up and earn your Super User badge! The new “Super User in Training” initiative is a great way for you to begin building your solution rate, engage with other community members, and find out what it takes to truly be SUPER.   Become a “super solver” across the Power Platform communities, whether you’re an expert in Power Apps or just getting started with Power Pages. No matter where you are on your Power Platform journey, we are here to encourage YOU to discover YOUR superpower! Don't sell your self short, even as a newcomer to Power Platform or Dynamics 365 you are on a journey of discovery.  In fact in my experience people that are just starting out are often the ones that can solve some of the  most challenging problems because the research they are doing to get ramped up is exactly what the person asking for help is seeking!   Find out more about the SUIT program for “Super Users in Training” at the Power Platform Community Lounge at #MPPC23. Not at the Conference, just click this link to find out how to sign up today: aka.ms/suit

Back to Basics: Tuesday Tip #2: All About Community Ranks

This weekly series is our way of helping the amazing members of our community--both new members and seasoned veterans--learn and grow in how to best engage in the community! Each Tuesday, we will feature new areas of content that will help you best understand the community--from ranking and badges to profile avatars, from Super Users to blogging in the community. Our hope is that this information will help each of our community members grow in their experience with Power Platform, with the community, and with each other!   Have you ever wondered how your fellow community members earn the different ranks available? What is the difference between an Advocate and a Helper, a Solution Sage and a Community Champion? In today's #TuesdayTip, we share the secrets and tips to help YOU keep your ranking growing--and why it's so important to our communities. What are community ranks? - Power Platform Community (microsoft.com)   Get the details in this Knowledge Base article that shows you what ranks are, how they are achieved, and what they mean to you as you engage with other community members on a regular basis. Once you start your journey in the community, ranking up, you'll find the benefits. So get busy with those kudos, solutions, and more! We can't wait to see how you rank!That's it for this week. Tune in for more Tuesday Tips next Tuesday and join the community as we continue to get "Back to Basics."

It's #MPPC23 Week! Check Out the Community Sessions and Events Happening in Vegas

After all the planning and preparing, the annual Microsoft Power Platform Conference is finally here! We are excited to see so many of our community in Las Vegas this week. To help make sure you don't miss any of the workshops, sessions, and events we have planned, make sure to check out this handy Community One-Sheet, and download the pdf today! Make sure to stop by the Community Lounge to meet @hugobernier, @EricArcher, @heaher_italent, and @AshleyFelts from our team!    

Join Us for the First-Ever Biz Apps Community User Group Meeting: Live from MPPC23

      Join us for the first-ever the Biz Apps Community User Group meeting live from the Power Platform Conference! This one hour user group meeting is all about discovering the value and benefits of User Groups! Discover how you can find a group in your local area or about specific topics where you can learn new skills and meet like-minded people as a user group member.   Hear from User Group leaders about why they do what they do and what resources they receive to help them succeed as community ambassadors. If you have never attended a User Group meeting before, this will be a great introduction! We hope you are inspired to find a group that meets your unique interests!   October 5th at 2:15 pm Pacific time   If you're attending #MPPC23 in Las Vegas, join us in person! Find out more here: https://powerplatformconf.com/#!/session/Biz%20Apps%20Community%20User%20Group%20Meeting%20-%20Live%20from%20MPPC/6172   Not at MPPC23? Attend vvirtually by registering here: https://aka.ms/MPPCusergroupmeeting2023    If you can't attend this meeting live, don't worry! We will record this meeting and share it with the Community at powerusers.microsoft.com 

Back to Basics: Tuesday Tip #1: All About YOUR Community Account

We are excited to kick off our new #TuesdayTIps series, "Back to Basics." This weekly series is our way of helping the amazing members of our community--both new members and seasoned veterans--learn and grow in how to best engage in the community! Each Tuesday, we will feature new areas of content that will help you best understand the community--from ranking and badges to profile avatars, from Super Users to blogging in the community. Our hope is that this information will help each of our community members grow in their experience with Power Platform, with the community, and with each other!     This Week's Tips: Account Support: Changing Passwords, Changing Email Addresses or Usernames, "Need Admin Approval," Etc.Wondering how to get support for your community account? Check out the details on these common questions and more. Just follow the link below for articles that explain it all.Community Account Support - Power Platform Community (microsoft.com)   All About GDPR: How It Affects Closing Your Community Account (And Why You Should Think Twice Before You Do)GDPR, the General Data Protection Regulation (GDPR), took effect May 25th 2018. A European privacy law, GDPR imposes new rules on companies and other organizations offering goods and services to people in the European Union (EU), or that collect and analyze data tied to EU residents. GDPR applies no matter where you are located, and it affects what happens when you decide to close your account. Read the details here:All About GDPR - Power Platform Community (microsoft.com)   Getting to Know You: Setting Up Your Community Profile, Customizing Your Profile, and More.Your community profile helps other members of the community get to know you as you begin to engage and interact. Your profile is a mirror of your activity in the community. Find out how to set it up, change your avatar, adjust your time zone, and more. Click on the link below to find out how:Community Profile, Time Zone, Picture (Avatar) & D... - Power Platform Community (microsoft.com)   That's it for this week. Tune in for more Tuesday Tips next Tuesday and join the community as we get "Back to Basics."

Announcing the MPPC's Got Power Talent Show at #MPPC23

Are you attending the Microsoft Power Platform Conference 2023 in Las Vegas? If so, we invite you to join us for the MPPC's Got Power Talent Show!      Our talent show is more than a show—it's a grand celebration of connection, inspiration, and shared journeys. Through stories, skills, and collective experiences, we come together to uplift, inspire, and revel in the magic of our community's diverse talents. This year, our talent event promises to be an unforgettable experience, echoing louder and brighter than anything you've seen before.    We're casting a wider net with three captivating categories:  Demo Technical Solutions: Show us your Power Platform innovations, be it apps, flows, chatbots, websites or dashboards... Storytelling: Share tales of your journey with Power Platform. Hidden Talents: Unveil your creative side—be it dancing, singing, rapping, poetry, or comedy. Let your talent shine!    Got That Special Spark? A Story That Demands to Be Heard? Your moment is now!  Sign up to Showcase Your Brilliance: https://aka.ms/MPPCGotPowerSignUp  Deadline for submissions: Thursday, Sept 28th    How It Works:  Submit this form to sign up: https://aka.ms/MPPCGotPowerSignUp  We'll contact you if you're selected. Get ready to be onstage!  The Spotlight is Yours: Each participant has 3-5 minutes to shine, with insightful commentary from our panel of judges. We’re not just giving you a stage; we’re handing you the platform to make your mark.     Be the Story We Tell: Your talents and narratives will not just entertain but inspire, serving as the bedrock for our community’s future stories and successes.    Celebration, Surprises, and Connections: As the curtain falls, the excitement continues! Await surprise awards and seize the chance to mingle with industry experts, Microsoft Power Platform leaders, and community luminaries. It's not just a show; it's an opportunity to forge connections and celebrate shared successes.    Event Details:  Date and Time: Wed Oct 4th, 6:30-9:00PM   Location: MPPC23 at the MGM Grand, Las Vegas, NV, USA  

Users online (2,239)