cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
venseben
Helper V
Helper V

Get value from SharePoint dropdown expression

Hi all. I have a bit of trouble by getting the value from af SharePoint dropdown list column. My flow i all in all simple, but it failes when I want to update a dropdown field with data from another dropdown field. I is the same data, so everything should be allright.

 

When I get the items, I make a filter array to get the items where claims from a person equals claims from another list. That works fine. 

Picture01.jpg

 

Picture02.jpg

When I want to update the dropdown field I can only get the ID, not the value. I have tried several things, but cannot get it to work.

I har tried to insert this expression: items('Apply_to_each')['NettobeloebEllerProcent#Value'], but that does not work, it only works with items('Apply_to_each')['NettobeloebEllerProcent#ID'], but that only gives me the number, and not the actually value.

 

This is what I get in the body of my filter array:

"NettobeloebEllerProcent": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "Nettobeløb"

And this is what I get from the body in the SharePoint list if I use #ID in the expression:

"NettobeloebEllerProcent": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": -1,
"Value": "1"

 

Can anyone guide me in the right direction?

 

THX in advance

/Frank

Denmark

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @venseben ,

the standard way to navigate a JSON is to use ['element']?['element2'] etc. therefore, I'd try to use:

items('Apply_to_each')['NettobeloebEllerProcent']?['Id']
or
items('Apply_to_each')['NettobeloebEllerProcent']?['Value']


[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

2 REPLIES 2
tom_riha
Super User
Super User

Hello @venseben ,

the standard way to navigate a JSON is to use ['element']?['element2'] etc. therefore, I'd try to use:

items('Apply_to_each')['NettobeloebEllerProcent']?['Id']
or
items('Apply_to_each')['NettobeloebEllerProcent']?['Value']


[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Hi @tom_riha THX man, this is a live saver for me. I still had problems when performing the flow, I got the message

 

"The template language expression 'items('Apply_to_each')['NettobeloebEllerProcent']?['Value']' cannot be evaluated because property 'NettobeloebEllerProcent' doesn't exist"

 

I found that it was because the field was empty. As soon as the field had a value it worked like a charm. No I just have to find a way to avoid that error, so the flow can be completed. Have a mary christmas 🎄🎅

 

/Frank

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,312)