cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Need to Extract Value from Variable Array by Key in Pair

Hello,

 

My challenge is to obtain the numeric value that has been paired with a string key name stored in a Variable Array named T Factors (e.g. ["Readiness,3"]).  The final goal is to insert that numeric value into a numeric column for a single Sharepoint list item.

 

Perhaps I'm trying to overthink this or simplify this too much, but after a day of attempts, I'm lost.

 

Any help provided would be greatly appreciated.

 

Thank you,

 

Doug

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User II
Dual Super User II

Re: Need to Extract Value from Variable Array by Key in Pair

Hi @DougMyers 

 

Array - ["Readiness,3"]

Use expressions

 

int(variables('varname')?[1])  - this will give you the number 3

variables('varname')?[0] - this will give you the string Readiness

 

varname - name of your variable

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

 

 

 

View solution in original post

4 REPLIES 4
Highlighted
Dual Super User II
Dual Super User II

Re: Need to Extract Value from Variable Array by Key in Pair

Hi @DougMyers 

 

Array - ["Readiness,3"]

Use expressions

 

int(variables('varname')?[1])  - this will give you the number 3

variables('varname')?[0] - this will give you the string Readiness

 

varname - name of your variable

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

 

 

 

View solution in original post

Highlighted
Helper I
Helper I

Re: Need to Extract Value from Variable Array by Key in Pair

Thank you for the insight.

 

I tried the basic one and cannot get it to work.  Here are a few ways I tried (placing in a text column for now):

 

variables('T Factor'?[1]) (This is pointing the the Variable Array.)
variables('Readiness'?[1])
 
I get "The expression is invalid." when I try to save it.
 
Note:
 
There are 27 items in the array T Factor.   Here's how I build the Variable Array key-value pair:
 
MSFLOW.PNG
 
Any further advice?
 
Cheers.
Highlighted
Helper I
Helper I

Re: Need to Extract Value from Variable Array by Key in Pair

Correction:

 

variables('T Factor')?[1] obtains the 2nd pair within the array but does not allow for obtaining a specific key OR value.
Highlighted
Community Support
Community Support

Re: Need to Extract Value from Variable Array by Key in Pair

Hi @DougMyers ,

 

Have your problem be solved?  If yes, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

 

Best Regards,

Alice

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (7,738)