cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lachlanP
Helper II
Helper II

Selecting a component of a record based on another column

I have a column, "JSON" where each field is a record, and another column "ref1" which holds a reference to the JSON record. In this example it's just the text "accel" (one of the elements in the json record), but in practice each row would be different.

lachlanP_0-1654890875811.png

I am trying to create a new column which pulls out the "accel" value from the json array. This is what Ive tried:

lachlanP_1-1654890957032.png

But the problem is, it is looking for the value "A", not the value the variable holds, which is [ref1] or "accel".

lachlanP_2-1654891016807.png

 

Is there a way to use the square brackets selector to pick an element in the record, but use some sort of syntax to insert the actual value of my variable in? Something like:

A = [ref1]

element = [JSON][[A]] or

element = [JSON][#"A"]

 

where it references the value of the variable A, not the string "A".

 

Thank you!

1 ACCEPTED SOLUTION
lachlanP
Helper II
Helper II

I figured out a solution. Instead of referencing using:

element = [JSON][A]

I used:

Record.Field([JSON],[A])

 

This worked!

View solution in original post

1 REPLY 1
lachlanP
Helper II
Helper II

I figured out a solution. Instead of referencing using:

element = [JSON][A]

I used:

Record.Field([JSON],[A])

 

This worked!

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors