cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Daniel-Kendall
Frequent Visitor

Why aren't these two equivalent String() and variable as string

So I have an Array (userListAttach) of multiples links i.e. 

 

{
  "Name": "@{items('Apply_to_each')['name']}",
  "ContentBytes": "@{body('Get_file_content_using_path')}",
  "link": "@{items('Apply_to_each')['link']}"
}

 

 

To add as a property if I do:

variables('userListAttach')?[0]?['link'] after initialising a string variable it works.


HOWEVER if I do:
string(variables('userListAttach')?[0]?['link'])

it fails.

Why?!
1 ACCEPTED SOLUTION

Accepted Solutions
Daniel-Kendall
Frequent Visitor

userListAttach is an Array.
It contains multiple 'links' keys I want to treat the value of as strings to pass as a URL to sharepoint.
if I do:
variables('userListAttach')?[0]?['link'] after initialising a string variable it works.
HOWEVER if I do:
string(variables('userListAttach')?[0]?['link'])

It wasn't working

Weird it is working now, I just flan the flow again.


Technology gremlins

View solution in original post

2 REPLIES 2
abm
Super User
Super User

Hi @Daniel-Kendall 

 

What error you getting using this expression?

 

string(variables('userListAttach')?[0]?['link'])

 

Variable 'userListAttach' is already a string? Believe you already declared that as a variable so why you need to convert to string again?

 

A screenshot of your flow will be helpful to analyse?

 

Thanks

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
Daniel-Kendall
Frequent Visitor

userListAttach is an Array.
It contains multiple 'links' keys I want to treat the value of as strings to pass as a URL to sharepoint.
if I do:
variables('userListAttach')?[0]?['link'] after initialising a string variable it works.
HOWEVER if I do:
string(variables('userListAttach')?[0]?['link'])

It wasn't working

Weird it is working now, I just flan the flow again.


Technology gremlins

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,815)