cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PPG-Ezra
Helper I
Helper I

Display term store value only and not receive entire string in a variable

Hello World!

 

I have a flow which runs successfully. However, of the 4 fields which come from Sharepoint metadata, 1 of them emanates from the term store and one from a dropdown list. When the flow runs, and the script takes the selected variables and sends them via email, the output is as follows:

 

 

Facility Name

Vendor Name

Service

Renewal Notice Date

[{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy","TermGuid":"a8150466-ae48-479a-acc7-58d619607036","WssId":3,"Label":"Facility Name","Path":null,"Value":"Facility Name|a8150466-ae48-479a-acc7-58d619607036"}]

Vendor Name

[{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"Service"}]

2022-02-25

 

For the fields of Facility Name and Service, i would like the script only to send the Value portion of the strings, and not the entire string. 

 

All help is appreciated.

Thank you

Ezra

1 ACCEPTED SOLUTION

Accepted Solutions
DamoBird365
Microsoft
Microsoft

Hi @PPG-Ezra 

 

What you've got there is an array.  You can select the key value by constructing an expression.  If I copy your array as an object i.e. everything within {} I can query it by adding ?['value'] to the end of the expression.

 

DamoBird365_0-1652725611963.png

 

If I was to be working with an array [], I would need to get the first() object {}.  I can do this as follows:

 

first(outputs('compose'))?['value'] OR outputs('compose')?[0]?['value']

 

I've a wee video on basic JSON expressions here https://youtu.be/6nJSUNh579w


Cheers
Damien

Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts. Thanks

 

View solution in original post

2 REPLIES 2
DamoBird365
Microsoft
Microsoft

Hi @PPG-Ezra 

 

What you've got there is an array.  You can select the key value by constructing an expression.  If I copy your array as an object i.e. everything within {} I can query it by adding ?['value'] to the end of the expression.

 

DamoBird365_0-1652725611963.png

 

If I was to be working with an array [], I would need to get the first() object {}.  I can do this as follows:

 

first(outputs('compose'))?['value'] OR outputs('compose')?[0]?['value']

 

I've a wee video on basic JSON expressions here https://youtu.be/6nJSUNh579w


Cheers
Damien

Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts. Thanks

 

PPG-Ezra
Helper I
Helper I

thank you @DamoBird365 

 

the issue i am having now is that the expression would need to extract the value of an array which is already part of a for-each loop. 

 

the previous output is @{outputs('Get_files_(properties_only)')?['body/value']}, followed by a date condition. 

if true, i need to append that set of variables to an array, one of which is Facility Name. 

when i insert your formula as the following: 

outputs(outputs('Get_files_(properties_only)')?['body/value'])?[0]?['Value']
 
and get an error, The template function 'outputs' is not expected at this location.
 
thank you for all your time and help.
Ezra

 

 

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.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,862)