Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Get Previous version values for Choice column in Mail

(0) ShareShare
ReportReport
Posted on by

Hi @Expiscornovus 

 

Thanks for looking into my issue 

 

I followed Reza Dorrani Video for "Power Automate SharePoint Item Modified flow | Track Column Changes"

 

I have referred Ur articles for creating a flow from SharePoint to mail. 

 

Danny_Dicaprio_0-1714393783418.png

First Send an Http Request 

Danny_Dicaprio_4-1714394227014.png

 

Second one is empty 

 

Danny_Dicaprio_1-1714393881809.png

 

Iam getting following error in my flow 

 

Danny_Dicaprio_2-1714393996282.png

 

 

_api/web/lists/GetByTitle('Risk_Database')/fields?$select=Title,InternalName&$filter=InternalName eq '@{item()}'
body('Send_an_HTTP_request_to_SharePoint_-_Title')['value'][0]['Title']
coalesce(body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']?[0]?[item()], '')
 
nvalidTemplate. Unable to process template language expressions in action 'Append_to_array_variable' inputs at line '0' and column '0': 'The template language expression 'body('Send_an_HTTP_request_to_SharePoint_-_Title')['value'][0]['Title']' cannot be evaluated because property 'value' doesn't exist, available properties are 'd'. Please see https://aka.ms/logicexpressions for usage details.'.
 
 
 
Could u please help meto fix this issue 
Categories:
  • Re: Get Previous version values for Choice column in Mail

    HI @Expiscornovus 

     

    Thanks for the knowlede , I had this issue before , I have rectified it using one of ur articles!

     

    But now, I have crossed checked the column values it's not null. 

    Danny_Dicaprio_0-1714468568075.png

     

    The above image is the version history after I made changes to the one of my SP LISTS Version 6

    If u could check the version of the flow in SEND AN HTTP

     

     "parameters/uri": "_api/web/lists/GetByTitle('Risk_Database')/items(16)/versions?$filter=VersionLabel eq '5.0'&$select=Risk_status,AssetsImpacted,Financial_impact,Stage_of_risk,Risk_rating0,Risk_rating,Risk_treatment_type,Modified"}
       Here Iam getting the previous version 5.0
     
    Danny_Dicaprio_1-1714469070038.png

     

     In the flow Iam able to get the previous version value but for the current one it is showing as blank 
     
    body('Send_an_HTTP_request_to_SharePoint_-_Title')['value'][0]['Title']
    coalesce(body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']?[1]?[item()], '')
    coalesce(body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']?[0]?[item()], '')
     
    Please have a look 
     

     

  • Expiscornovus Profile Picture
    Expiscornovus 31,144 on at
    Re: Get Previous version values for Choice column in Mail

    Hi @Danny_Dicaprio,

     

    Edit:  I now notice you are using the same expression only with an index of [1] for the Value property. It is looking for the second item in the results of the version history 😅

     

    But this HTTP request will only return one item. Where did you find this expression, or why are you using an index of [1]?

     

    Just to double check. Fields can be empty in your list item before you changed it/updated the list item. So, technically it is possible that a field was empty before you updated it and the Value property would be null/empty.

     

    Can you double check this isn't the case with your test?

     

    Below is an example where it was the case in my test run. It would be useful to see your Body and also to see which version of the item you are retrieving, is it version 1.0?

     

     

     

    emptybefore.png

  • Re: Get Previous version values for Choice column in Mail

    Hi @Expiscornovus 

     

    Only the second one has the headers 

     

    Danny_Dicaprio_1-1714466271012.png

     

     

    Still the current value is showing as blank

     

    can u please help me with it 

  • Expiscornovus Profile Picture
    Expiscornovus 31,144 on at
    Re: Get Previous version values for Choice column in Mail

    Hi @Danny_Dicaprio,

     

    Make sure only the second Send an HTTP request to SharePoint action uses the nometadata headers, the first one doesn't need those headers. 

     

    And can you also share a screenshot of the outputs of the first HTTP action of your last flow run?

     

    headers_peraction.png

     

     

  • Re: Get Previous version values for Choice column in Mail

    Hi @Expiscornovus 

     

    Thanks for the response, It worked!🙌 

     

    But each time some new issue is happening, I have a person type column, lookup column, choice column.

     

    Values from these columns are shown blank,

     

    Can u please help to understand why these columns are blank? 

     

    Also, I tried to update the flow by adding current values. But the current value is not showing up.

    Danny_Dicaprio_0-1714459115826.png

     

    body('Send_an_HTTP_request_to_SharePoint_-_Title')['value'][0]['Title']
    coalesce(body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']?[1]?[item()], '')
    coalesce(body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']?[0]?[item()], '')

    Danny_Dicaprio_2-1714459533868.png

     

     

    Value is shown as blank

    Danny_Dicaprio_1-1714459245586.png

     

    Column<b> @{items('Apply_to_each_VarValues')?['Column']}</b>has updated from<b style='colorred'>@{items('Apply_to_each_VarValues')?['value']} </b>to<b style='Color:green'> @{items('Apply_to_each_VarValues')?['CurrentValue']}</b>

     

    Could u please help me with this issue , what would be the reason for the "Value"  not showing up 

     

     

  • Expiscornovus Profile Picture
    Expiscornovus 31,144 on at
    Re: Get Previous version values for Choice column in Mail

    Hi @Danny_Dicaprio 

     

    I see the action is returning results, so that part is fixed. The reason the expression is not working is because the nometadata headers are missing in the Send an HTTP Request to SharePoint action, like in the screenshot my example:

    https://powerusers.microsoft.com/t5/Building-Flows/Expression-Not-Valid-Power-Automate-SharePoint-Item-Modified/m-p/1770536/highlight/true#M195765

     

    When you don't not use those headers, the d property will be returned, which is not part of the expression you are using in the append to variable action.

     

    Can you add the headers to fix this?

    Accept application/json;odata=nometadata 

    Content-Type application/json;odata=nometadata

  • Re: Get Previous version values for Choice column in Mail

    Hi @Expiscornovus 

     

    Sorry for the delayed response

     

    I have made the changes, but the flow is not running properly. 

     

    It is continuously showing a similar error 

     

    InvalidTemplate. Unable to process template language expressions in action 'Append_to_array_variable' inputs at line '0' and column '0': 'The template language expression 'body('Send_an_HTTP_request_to_SharePoint_Title')['value'][0]['Title']' cannot be evaluated because property 'value' doesn't exist, available properties are 'd'. Please see https://aka.ms/logicexpressions for usage details.'.

     

    Danny_Dicaprio_0-1714451746848.png

     

    Danny_Dicaprio_1-1714451793590.png

     

    Danny_Dicaprio_2-1714451825498.png

     

    Danny_Dicaprio_4-1714451910325.png

     

    body('Send_an_HTTP_request_to_SharePoint_Title')['value'][0]['Title']
    coalesce(body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']?[0]?[item()],'')

     

  • Expiscornovus Profile Picture
    Expiscornovus 31,144 on at
    Re: Get Previous version values for Choice column in Mail

    Hi @Danny_Dicaprio,

     

    Looks like you have made a small typo in the ColumnName value of the Map field of your first Select action.

     

    That's why the value shows up with leading space, for example ' Risk_status' instead of 'Risk_status'

     

    Can you remove the space character in front of the replace expression?

    smalltypo_space.png

     

     

     

     

  • Re: Get Previous version values for Choice column in Mail

    Hi @Expiscornovus 

     

    Thanks for the reply ,Please find the screen shot below 

     

    Danny_Dicaprio_2-1714395459137.png

     

    Danny_Dicaprio_1-1714395405928.png

     

     

    Danny_Dicaprio_0-1714395374581.png

     

  • Expiscornovus Profile Picture
    Expiscornovus 31,144 on at
    Re: Get Previous version values for Choice column in Mail

    Hi @Danny_Dicaprio,

     

    It looks like it cannot find the field. The loop is normally using the outputs of the Set Column Names action. Can you share the outputs of your Set Column Names action? This will help the troubleshooting for us.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard