cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oyin
Advocate V
Advocate V

Power Automate choice fields displaying numbers

The choice fields in the body of my email, Animal Type and Sex are displaying their number equivalents.

I have applied Co-pilot's suggestion but it broke the entire code.

Has anyone encountered this? I need help pls

Thanks!

Choice.png

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Corry
Advocate V
Advocate V

@Oyin,

I too ran into this quirk today.

 

After a little research, I found this article that helped me How to get OptionSet/ Choice text from DataVerse in Power Automate.

This is what my flow looks like.

Corry_0-1716081355654.png

 

Trigger - When a row is added, modified or deleted

Corry_1-1716081400306.png

 

1. Action - Get a row by ID

Corry_2-1716081539711.png

Row ID - the Unique identifier column within your table.

Corry_3-1716081634643.png

 

Initialize variable

Corry_4-1716081701451.png

Value - Based on the article I mentioned, this is the expression that gets the text of the choice value.

In my instance, it looks like this:

 

outputs('Get_a_row_by_ID')['body']['cc_animaltype@OData.Community.Display.V1.FormattedValue']

 

Condition - checking if the shelter status equals the choice value of Shelter Status - Claimed for Foster, which the value for me is 333330006.

Corry_5-1716081899534.png

 

Send an email

Here you can construct your email as before and add the variable/s that get the choice text.

For example:

 

Animal Type: variables('varAnimalTypeLabel')

Corry_6-1716082080304.png


I am not sure on the approach for multiple choice values, but I would assume you can add an additional 'Initialize Variable' to capture the text of another choice.

This is the final output from my flow.

Corry_0-1716082783040.png

 

View solution in original post

Hi @Dianah_Ebere

  1. How were you able embed the image url into the email such that it shows the actual image?
    1. I have used HTML for my email body which allows me to utilize the Photo URL column in the Animals table.
    2. Clicking on the icon I have outlined in red in the below image switches the body to HTML editor mode.
    3. Corry_0-1716168140823.png
    4. This is the HTML code I am using for the image, (the red highlighted text was inserted using 'Dynamic Content'):
      1. <img src="@{body('Get_a_row_by_ID')?['cr0f4_photourl']}" alt="@{body('Get_a_row_by_ID')?['cr0f4_photoname']}" style="width: auto; height: 150px;">
    5. Things to note, you may not be able to toggle off code view when editing in this way. You can use an HTML editor to structure your code if needed. This is very helpful: W3Schools HTML Editor.
    6. The following are 'Dynamic Content' inserted within the HTML; you will need to ensure the dynamic content is placed between quotes "".
      1. @{body('Get_a_row_by_ID')?['cr0f4_photourl']} - This is the column your URL is stored in within your table.
      2. @{body('Get_a_row_by_ID')?['cr0f4_photoname']} - This is the name of the photo, also a column in your table. This is also optional but great to have if your photo doesn't load or when saving the photo.
      3. style="width: auto; height: 150px; - This is optional, but I found these to be the optimal settings to make sure the photo is proportional to the email.
  2. I am still experiencing some errors using the initialize variable, the output isn't giving the expected value..., so I am unable to still see the text value of my choice field.
    1. For the 'Initialize Variable' you need to enter an 'Expression' for the 'Value' and not 'Dynamic Content'. Simply copy/paste the following into the 'Insert Expression Window' and click 'Add'. (Adjust the 'Get_a_row_by_ID' & 'cc_animaltype' to suit your solution)
      1. outputs('Get_a_row_by_ID')['body']['cc_animaltype@OData.Community.Display.V1.FormattedValue']
    2. Things to note. When you enter the expression, it will appear like the below image.
    3. Corry_3-1716170167162.png
    4. Save and test your flow and it should convert to green and not pink.
    5. Corry_4-1716170255199.png

 

Any issue, let me know and I will respond ASAP.

View solution in original post

14 REPLIES 14
Corry
Advocate V
Advocate V

@Oyin,

I too ran into this quirk today.

 

After a little research, I found this article that helped me How to get OptionSet/ Choice text from DataVerse in Power Automate.

This is what my flow looks like.

Corry_0-1716081355654.png

 

Trigger - When a row is added, modified or deleted

Corry_1-1716081400306.png

 

1. Action - Get a row by ID

Corry_2-1716081539711.png

Row ID - the Unique identifier column within your table.

Corry_3-1716081634643.png

 

Initialize variable

Corry_4-1716081701451.png

Value - Based on the article I mentioned, this is the expression that gets the text of the choice value.

In my instance, it looks like this:

 

outputs('Get_a_row_by_ID')['body']['cc_animaltype@OData.Community.Display.V1.FormattedValue']

 

Condition - checking if the shelter status equals the choice value of Shelter Status - Claimed for Foster, which the value for me is 333330006.

Corry_5-1716081899534.png

 

Send an email

Here you can construct your email as before and add the variable/s that get the choice text.

For example:

 

Animal Type: variables('varAnimalTypeLabel')

Corry_6-1716082080304.png


I am not sure on the approach for multiple choice values, but I would assume you can add an additional 'Initialize Variable' to capture the text of another choice.

This is the final output from my flow.

Corry_0-1716082783040.png

 

Oyin
Advocate V
Advocate V

Thanks so much for the elaborate response @Corry .

 

I will try this out. I hope it works for me too.

heey corry,

in the Initialize variable step , when I write the fx outputs('Get_a_row_by_ID')['body']['ac_animaltype@OData.Community.Display.V1.FormattedValue'] , it not been datavers it shows as fx as in the below screenshot

 

compose.PNG

and in Get a row by Id is:

get row by id.png

please help

 

 

@Esraa_k,

 

You are using a ‘Compose’ variable instead of the Initialize’ variable. Search for Initialize Variable when adding an action and check it matches my screenshot.

 

The Row ID looks fine. To make sure, when adding the dynamic value to Row ID, it will say it’s the Unique Identifier just below the dynamic option in the list.

 

You can also look at your table columns in your solution to find the Unique Identifier.

@Corry 
Thanks for this explanation, 
Please, I have got 2 follow up questions; 
1. How were you able embed the image url into the email such that it shows the actual image? 

2. I am still experiencing some errors using the initialize variable, the output isn't giving the expected value..., so I am unable to still see the text value of my choice field.
See image below: 

Screenshot (87).png

 

Screenshot (88).png

 

Hi @Dianah_Ebere

  1. How were you able embed the image url into the email such that it shows the actual image?
    1. I have used HTML for my email body which allows me to utilize the Photo URL column in the Animals table.
    2. Clicking on the icon I have outlined in red in the below image switches the body to HTML editor mode.
    3. Corry_0-1716168140823.png
    4. This is the HTML code I am using for the image, (the red highlighted text was inserted using 'Dynamic Content'):
      1. <img src="@{body('Get_a_row_by_ID')?['cr0f4_photourl']}" alt="@{body('Get_a_row_by_ID')?['cr0f4_photoname']}" style="width: auto; height: 150px;">
    5. Things to note, you may not be able to toggle off code view when editing in this way. You can use an HTML editor to structure your code if needed. This is very helpful: W3Schools HTML Editor.
    6. The following are 'Dynamic Content' inserted within the HTML; you will need to ensure the dynamic content is placed between quotes "".
      1. @{body('Get_a_row_by_ID')?['cr0f4_photourl']} - This is the column your URL is stored in within your table.
      2. @{body('Get_a_row_by_ID')?['cr0f4_photoname']} - This is the name of the photo, also a column in your table. This is also optional but great to have if your photo doesn't load or when saving the photo.
      3. style="width: auto; height: 150px; - This is optional, but I found these to be the optimal settings to make sure the photo is proportional to the email.
  2. I am still experiencing some errors using the initialize variable, the output isn't giving the expected value..., so I am unable to still see the text value of my choice field.
    1. For the 'Initialize Variable' you need to enter an 'Expression' for the 'Value' and not 'Dynamic Content'. Simply copy/paste the following into the 'Insert Expression Window' and click 'Add'. (Adjust the 'Get_a_row_by_ID' & 'cc_animaltype' to suit your solution)
      1. outputs('Get_a_row_by_ID')['body']['cc_animaltype@OData.Community.Display.V1.FormattedValue']
    2. Things to note. When you enter the expression, it will appear like the below image.
    3. Corry_3-1716170167162.png
    4. Save and test your flow and it should convert to green and not pink.
    5. Corry_4-1716170255199.png

 

Any issue, let me know and I will respond ASAP.

Oyin
Advocate V
Advocate V

Thanks @Corry , it worked!

 

choice working.png

Hi all.

 

I wanted to follow up with a little more explanation with the variable expression as the article I referenced is a little confusing. Below are my steps to retrieve the information I need for the Initialize Variable.

 

Summary of Steps

  1. Create a copy of existing flow and edit the flow. Alternatively, you can create a new flow with the trigger 'When a row is added, modified or deleted' and the action 'Get a row by ID'.
  2. Save and manually test the flow. (You will need to modify a single field in the animal table to trigger the flow).
  3. Navigate back to your flow once you have modified a field. You flow should be successful.
  4. Click on the 'Get a row by ID' and scroll down to the 'OUTPUTS' section.
  5. Open the Notepad app on your windows device or any other equivalent app.
  6. Go back to your OUTPUTS within the flow and select the 'Copy' icon in the 'body' section.
  7. Paste the copied body content into your Notepad app.
  8. With the Notepad app still open, hold CTRL and F to open the 'Find' feature. Enter the 'Logical name' of your choice column and press enter. This is where you will find the section of the variable expression that essentially grabs the text value of your choice field.
  9. Copy the "cc_animaltype@OData.Community.Display.V1.FormattedValue" as it is displayed for you. Use this in your variable expression.

 

Steps with Images

  1. Create a copy of existing flow and edit the flow so your copy looks like this below image.
    1. Alternatively, you can create a new flow with the below trigger and action. Refer to my initial post for Trigger and Action parameters.
    2. Corry_0-1716202465804.png

       

  2. Save and manually test the flow. (You will need to modify a single field in the animal table to trigger the flow).
    1. Corry_1-1716202465627.png

       

       

  3. Navigate back to your flow once you have modified a field. You flow should be successful and look like this image.
    1. Corry_2-1716202465989.png

       

  4. Click on the 'Get a row by ID' and scroll down to the 'OUTPUTS' section.
    1. Corry_3-1716202465795.png

       

  5. Open the Notepad app on your windows device or any other equivalent app.
    1. Corry_4-1716202465799.png

       

  6. Go back to your OUTPUTS within the flow and select the 'Copy' icon in the 'body' section.
    1. Corry_5-1716202466294.png

       

  7. Paste the copied body content into your Notepad app.
    1. Corry_6-1716202465990.png

       

  8. With the Notepad app still open, hold CTRL and F to open the 'Find' feature. Enter the 'Logical name' of your choice column and press enter. This is where you will find the section of the variable expression that essentially grabs the text value of your choice field.
    1. Corry_7-1716202465944.png

       

  9. Copy the "cc_animaltype@OData.Community.Display.V1.FormattedValue" as it is displayed for you. Use this in your variable expression.
Jidde72
Frequent Visitor

Awesome @Corry it worked ...👍

Helpful resources

Announcements

Important Update | Power Up Community READ ONLY July 22 – July 28

Dear Community Members, As you may have read, the Power Platform communities are transitioning to a new platform and to access will be set to READ-ONLY mode during the transition. Key DatesTo ensure current learners have adequate support in the final week of the cohort, the Power Up Program Community will transition to READ-ONLY mode starting July 22nd, the platform will transition to READ-ONLY mode until July 28th. Power Apps, Power Automate, and Power Pages communities will be read-only July 16-22, 2024.During this period, members will not be able to start new threads or Kudo, Comment, or Reply to any posts, but will be able to search and review past threads or solutions. On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities. Learners will be able to sign in to the new Power Up Program community experience, starting July 29th. If you registered for community using your learnwithpowerup account, you will not receive an email, but should be able to sign in successfully if you are signed in to My hub.  If you need help with your community account, please submit a request at aka.ms/PPCommSupport We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead! 

Learn what to expect in the Power Up Program

Since its inception in 2022, the Power Up Program has evolved based on feedback from learners and Microsoft Partners and customers. Today's Power Up learners can expect to learn the fundamentals of Microsoft Power Platform in the accelerated seven-week, video-based Power Up Maker course.   Hear from Principal Program Manager, Dimpi Gandhi to discover the latest enhancements and meet the Microsoft MVPs, Rory Neary and Charlie Phipps, who partnered with the Microsoft Power Up Program to create the Power Up Maker course to guide learners to use the Microsoft Power Platform to develop custom applications, build dazzling report dashboards, or create efficiencies through automation.  

Welcome to the Power Up Program Community

The Power Up Program is a free upskilling program where nontechnical people can learn the fundamentals of Microsoft Power Platform. The Power Up Maker course is a seven-week self-paced virtual learning plan that include video-based objectives featuring Power Apps, Power BI and Power Automate.  As a member of the Power Up Community, you can grow your skills and build connections. You can post questions to get help with the curriculum and hands-on exercises from experts and peers in the product boards.  Check out the Community Information & Feedback board to find help or provide feedback with the community experience, and please take time to post in the Social board to tell us more about yourself. If you're new to the Power Up Program and looking for information to register. You can sign up at PowerUp.Microsoft.com.

Users online (1,145)