cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mccoydblueloop
Frequent Visitor

Converting strings to intergers

I'm doing a simple feedback survey which asks someone to rate their experience from 1-5, except I'm using emojis to represent those numbers. So the options are: 😠,🙁,😐,🙂,😀

 

I tried composing an array but I couldn't find an expression that searches the array and returns the index number. Something like getindex(array,item)

 

I found this: https://powerusers.microsoft.com/t5/Building-Flows/Return-the-index-that-contains-a-specific-value/t...

 

But I thought there might be a simpler way as my array will never change.

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @mccoydblueloop 

 

Here it is

 

image.png

 

 

See the above expression  I am using to get the index

 

My test results

 

image.png



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

3 REPLIES 3
abm
Super User III
Super User III

Hi @mccoydblueloop 

 

So your array size is 4 (index from 0 onwards). Believe what you are looking is which array cell /index have some value and rest all are blank.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
mccoydblueloop
Frequent Visitor

Sorry, I'm not following. The output from the choice of otions is going to be for arguments sake: terrible, bad, indifferent, good or great. So I create an aray:

 

['terrible','bad','indifferent','good','great']

 

So terrible is index 0, great is index 4. What function can I use to give it one of those strings and have it output the index (0-4)?

Hi @mccoydblueloop 

 

Here it is

 

image.png

 

 

See the above expression  I am using to get the index

 

My test results

 

image.png



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (3,090)