cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NurNina
Post Patron
Post Patron

Switch

Hi,I use Power Automate to submit data from Microsoft Form to dataverse. I included switch for a multichoice field:

 

NurNina_0-1637144170859.png

However, I cannot update the choice chosen into dataverse because it said no case contains a matching value, but obviously in Case1: IGF in the Private Sector is the same as the value from Form. 

 

7 REPLIES 7

It seems that the Switch is trying to match the text including quotes "[IGF in the Private Sector]" ?

 

Do you mean to check for just the text IGF in the Private Sector

2021-11-17_13-02-26.png

 

If the value is coming from an array, you will need to extract the first element of the array and use that in the Switch:

2021-11-17_13-06-06.png
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

 

@ekarim2020 thanks for the reply.

 

It's actually getting response from multiple choice of question from microsoft form:

NurNina_0-1637202927776.png

 

how do I pass multichoice string to a multichoice field in dataverse?or do I need to change it to textfield? 

 

Because the form field is a multiple choice field, the response is going to be returned as a string:

2021-11-18_08-22-17.png

 

For a multi-choice field we could create an array of items from the responses. We could then loop through each item (Apple, Pear, Banana, Manago...), and use the Switch action to act on each response.

 

2021-11-18_08-48-00.png

 

2021-11-18_08-50-12.gif


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

NurNina
Post Patron
Post Patron

@ekarim2020 so can I use switch to pass the choices to an optionset (multichoice) field inside the dataverse? 

Yes, it would be possible to update a Dataverse Optionset/Choice. Although I rarely work with Dataverse I have updated an Optionset/Choice field in the past. It did involve more work than I was expecting! Still, we can give it a shot and maybe other experts can chip in if we get stuck.

 

Looking back at that old flow, we will need the Table name that needs to be updated:

2021-11-19_17-23-03.png

We will need a way to update the rows, such as a Unique Identifier:

2021-11-19_17-25-36.png

And you will also need the Optionset/Choice name and values. In this example below, the FruitChoice field is a multi-choice (Optionset) field, and the user can select from the values Apple, Pear, Banana or Mango:

2021-11-19_17-30-29.png

However, inside Dataverse the values Apple, Pear, Banana or Mango values are represented by integer values called attributevalue . We will need these integer values in order to set the Optionset/Choice field.

Example:

  "Apple"544500000
  "Pear"544500001
  "Banana"544500002
  "Mango"544500003
 
Setting the Optionset/Choice field value example:
2021-11-19_17-37-44.png
Sample run-time output:
2021-11-19_18-40-12.png
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

@ekarim2020 thanks for the help! but how do I convert the response to integer to pass it to dataverse? I've read something about int function but I don't really get the idea how to convert the response to integer by using the int function. 

Although the choice values are integers (or appear to be integers), the multi-Choice column in Dataverse takes a string as the example below illustrates:

2021-11-22_21-36-29.png

 

This is the sample output from the Update a row action:

2021-11-22_21-50-50.png

 

See the Image below which shows data from the demo Dataverse table, and the FruitChoice column which is now set to Apple and Mango by the demo flow:

2021-11-22_21-59-49.png

 

To get the integer values for the multi-choice column you will need to view the choice column and its options. You can do this from the Data menu from the flow as shown below:

2021-11-22_21-44-33.png

 

Using the image below as a reference: Select the (1) Data menu, (2) Choices menu, (3) Select your choice field. In my example, the choice field is called FruitChoice. Next (4) select the three dots ... next to one of the choice values (eg. choice Apple), then (5) click View more:

 

2021-11-22_21-40-24.png

 

The choice value for Apple is 544500000 - unfortunately Dataverse displays this as 544,500,000:

2021-11-22_21-42-30.png

 

Now you can get all the values for the multi-choice column.

 

Alternatively we could, with some work, write a flow to get all the multi-choice column values for us. We wouldn't need to hard-code any choice values in the flow, and when a new choice were added, we could also get its value dynamically.  We would map the choice to its value so that we could specify a choice and we could get back the choice value, for example:

 

 

Create a JSON object mapping choice to value:
{
  "Apple":  544500000,
  "Pear":   544500001,
  "Banana": 544500002,
  "Mango":  544500003
}

Then use an expressions to get the choice value:
outputs('Compose_Mapped_Table')?[<choice>] 	

outputs('Compose_Mapped_Table')?['Apple'] 	--> 544500000
outputs('Compose_Mapped_Table')?['Pear'] 	--> 544500001
outputs('Compose_Mapped_Table')?['Banana'] 	--> 544500002
outputs('Compose_Mapped_Table')?['Mango'] 	--> 544500003

 

 

 

There may be a better way to to all of this, but I hope this helps.

 


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

 

 

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   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.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Summer of Solutions | Week 3 Results | Win free tickets to the Power Platform Conference

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22  

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (5,052)